{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Create AI Machine Learning Agent That Makes 30+ ML Models In 30 Seconds\n",
    "\n",
    "In this notebook, I will show you how to create an AI machine learning agent that can make 30+ machine learning models in 30 seconds. This AI agent will be able to make models for classification and regression tasks. \n",
    "\n",
    "The AI agent uses `h2o` library for AutoML. `h2o` is an open-source machine learning platform that is used for building machine learning models. It is easy to use and provides a lot of flexibility in building machine learning models."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Want To Become A Full-Stack Generative AI Data Scientist?\n",
    "\n",
    "![Generative AI Data Scientist](../../img/become_a_generative_ai_data_scientist.jpg)\n",
    "\n",
    "I teach Generative AI Data Science to help you build AI-powered data science apps. [**Register for my next Generative AI for Data Scientists workshop here.**](https://learn.business-science.io/ai-register)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## H2O Machine Learning Agent\n",
    "\n",
    "In this notebook, we will create an AI Machine Learning Agent that makes 30+ machine learning models in 30 seconds. The AI Agent will use the H2O AutoML library to create the models, store the models on your computer, and provide you with a summary of the models, performance metrics, and full breakdown of the AI machine learning workflow."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load Libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "from langchain_openai import ChatOpenAI\n",
    "import pandas as pd\n",
    "import h2o # pip install h2o\n",
    "import os\n",
    "import yaml\n",
    "\n",
    "from ai_data_science_team.ml_agents import H2OMLAgent"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load The Customer Churn Dataset\n",
    "\n",
    "The Customer Churn dataset contains data on customers who have left the company. The dataset contains 21 columns and 7,043 rows. The target variable is `Churn` which is a binary variable that indicates whether the customer has left the company or not."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "index",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "customerID",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "gender",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "SeniorCitizen",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "Partner",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "Dependents",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "tenure",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "PhoneService",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "MultipleLines",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "InternetService",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "OnlineSecurity",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "OnlineBackup",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "DeviceProtection",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "TechSupport",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "StreamingTV",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "StreamingMovies",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "Contract",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "PaperlessBilling",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "PaymentMethod",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "MonthlyCharges",
         "rawType": "float64",
         "type": "float"
        },
        {
         "name": "TotalCharges",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "Churn",
         "rawType": "object",
         "type": "string"
        }
       ],
       "conversionMethod": "pd.DataFrame",
       "ref": "c83e5dac-07eb-4ab1-9efe-067990ef197e",
       "rows": [
        [
         "0",
         "7590-VHVEG",
         "Female",
         "0",
         "Yes",
         "No",
         "1",
         "No",
         "No phone service",
         "DSL",
         "No",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "29.85",
         "29.85",
         "No"
        ],
        [
         "1",
         "5575-GNVDE",
         "Male",
         "0",
         "No",
         "No",
         "34",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "No",
         "Yes",
         "No",
         "No",
         "No",
         "One year",
         "No",
         "Mailed check",
         "56.95",
         "1889.5",
         "No"
        ],
        [
         "2",
         "3668-QPYBK",
         "Male",
         "0",
         "No",
         "No",
         "2",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Mailed check",
         "53.85",
         "108.15",
         "Yes"
        ],
        [
         "3",
         "7795-CFOCW",
         "Male",
         "0",
         "No",
         "No",
         "45",
         "No",
         "No phone service",
         "DSL",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "No",
         "No",
         "One year",
         "No",
         "Bank transfer (automatic)",
         "42.3",
         "1840.75",
         "No"
        ],
        [
         "4",
         "9237-HQITU",
         "Female",
         "0",
         "No",
         "No",
         "2",
         "Yes",
         "No",
         "Fiber optic",
         "No",
         "No",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "70.7",
         "151.65",
         "Yes"
        ],
        [
         "5",
         "9305-CDSKC",
         "Female",
         "0",
         "No",
         "No",
         "8",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "No",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "99.65",
         "820.5",
         "Yes"
        ],
        [
         "6",
         "1452-KIOVK",
         "Male",
         "0",
         "No",
         "Yes",
         "22",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "Yes",
         "No",
         "No",
         "Yes",
         "No",
         "Month-to-month",
         "Yes",
         "Credit card (automatic)",
         "89.1",
         "1949.4",
         "No"
        ],
        [
         "7",
         "6713-OKOMC",
         "Female",
         "0",
         "No",
         "No",
         "10",
         "No",
         "No phone service",
         "DSL",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "No",
         "Mailed check",
         "29.75",
         "301.9",
         "No"
        ],
        [
         "8",
         "7892-POOKP",
         "Female",
         "0",
         "Yes",
         "No",
         "28",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "No",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "104.8",
         "3046.05",
         "Yes"
        ],
        [
         "9",
         "6388-TABGU",
         "Male",
         "0",
         "No",
         "Yes",
         "62",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "One year",
         "No",
         "Bank transfer (automatic)",
         "56.15",
         "3487.95",
         "No"
        ],
        [
         "10",
         "9763-GRSKD",
         "Male",
         "0",
         "Yes",
         "Yes",
         "13",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Mailed check",
         "49.95",
         "587.45",
         "No"
        ],
        [
         "11",
         "7469-LKBCI",
         "Male",
         "0",
         "No",
         "No",
         "16",
         "Yes",
         "No",
         "No",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "Two year",
         "No",
         "Credit card (automatic)",
         "18.95",
         "326.8",
         "No"
        ],
        [
         "12",
         "8091-TTVAX",
         "Male",
         "0",
         "Yes",
         "No",
         "58",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "No",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "One year",
         "No",
         "Credit card (automatic)",
         "100.35",
         "5681.1",
         "No"
        ],
        [
         "13",
         "0280-XJGEX",
         "Male",
         "0",
         "No",
         "No",
         "49",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "Yes",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Bank transfer (automatic)",
         "103.7",
         "5036.3",
         "Yes"
        ],
        [
         "14",
         "5129-JLPIS",
         "Male",
         "0",
         "No",
         "No",
         "25",
         "Yes",
         "No",
         "Fiber optic",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "105.5",
         "2686.05",
         "No"
        ],
        [
         "15",
         "3655-SNQYZ",
         "Female",
         "0",
         "Yes",
         "Yes",
         "69",
         "Yes",
         "Yes",
         "Fiber optic",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Two year",
         "No",
         "Credit card (automatic)",
         "113.25",
         "7895.15",
         "No"
        ],
        [
         "16",
         "8191-XWSZG",
         "Female",
         "0",
         "No",
         "No",
         "52",
         "Yes",
         "No",
         "No",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "One year",
         "No",
         "Mailed check",
         "20.65",
         "1022.95",
         "No"
        ],
        [
         "17",
         "9959-WOFKT",
         "Male",
         "0",
         "No",
         "Yes",
         "71",
         "Yes",
         "Yes",
         "Fiber optic",
         "Yes",
         "No",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Two year",
         "No",
         "Bank transfer (automatic)",
         "106.7",
         "7382.25",
         "No"
        ],
        [
         "18",
         "4190-MFLUW",
         "Female",
         "0",
         "Yes",
         "Yes",
         "10",
         "Yes",
         "No",
         "DSL",
         "No",
         "No",
         "Yes",
         "Yes",
         "No",
         "No",
         "Month-to-month",
         "No",
         "Credit card (automatic)",
         "55.2",
         "528.35",
         "Yes"
        ],
        [
         "19",
         "4183-MYFRB",
         "Female",
         "0",
         "No",
         "No",
         "21",
         "Yes",
         "No",
         "Fiber optic",
         "No",
         "Yes",
         "Yes",
         "No",
         "No",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "90.05",
         "1862.9",
         "No"
        ],
        [
         "20",
         "8779-QRDMV",
         "Male",
         "1",
         "No",
         "No",
         "1",
         "No",
         "No phone service",
         "DSL",
         "No",
         "No",
         "Yes",
         "No",
         "No",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "39.65",
         "39.65",
         "Yes"
        ],
        [
         "21",
         "1680-VDCWW",
         "Male",
         "0",
         "Yes",
         "No",
         "12",
         "Yes",
         "No",
         "No",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "One year",
         "No",
         "Bank transfer (automatic)",
         "19.8",
         "202.25",
         "No"
        ],
        [
         "22",
         "1066-JKSGK",
         "Male",
         "0",
         "No",
         "No",
         "1",
         "Yes",
         "No",
         "No",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "Month-to-month",
         "No",
         "Mailed check",
         "20.15",
         "20.15",
         "Yes"
        ],
        [
         "23",
         "3638-WEABW",
         "Female",
         "0",
         "Yes",
         "No",
         "58",
         "Yes",
         "Yes",
         "DSL",
         "No",
         "Yes",
         "No",
         "Yes",
         "No",
         "No",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "59.9",
         "3505.1",
         "No"
        ],
        [
         "24",
         "6322-HRPFA",
         "Male",
         "0",
         "Yes",
         "Yes",
         "49",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "Yes",
         "No",
         "Yes",
         "No",
         "No",
         "Month-to-month",
         "No",
         "Credit card (automatic)",
         "59.6",
         "2970.3",
         "No"
        ],
        [
         "25",
         "6865-JZNKO",
         "Female",
         "0",
         "No",
         "No",
         "30",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Bank transfer (automatic)",
         "55.3",
         "1530.6",
         "No"
        ],
        [
         "26",
         "6467-CHFZW",
         "Male",
         "0",
         "Yes",
         "Yes",
         "47",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "Yes",
         "No",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "99.35",
         "4749.15",
         "Yes"
        ],
        [
         "27",
         "8665-UTDHZ",
         "Male",
         "0",
         "Yes",
         "Yes",
         "1",
         "No",
         "No phone service",
         "DSL",
         "No",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "No",
         "Electronic check",
         "30.2",
         "30.2",
         "Yes"
        ],
        [
         "28",
         "5248-YGIJN",
         "Male",
         "0",
         "Yes",
         "No",
         "72",
         "Yes",
         "Yes",
         "DSL",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "90.25",
         "6369.45",
         "No"
        ],
        [
         "29",
         "8773-HHUOZ",
         "Female",
         "0",
         "No",
         "Yes",
         "17",
         "Yes",
         "No",
         "DSL",
         "No",
         "No",
         "No",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Mailed check",
         "64.7",
         "1093.1",
         "Yes"
        ],
        [
         "30",
         "3841-NFECX",
         "Female",
         "1",
         "Yes",
         "No",
         "71",
         "Yes",
         "Yes",
         "Fiber optic",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "No",
         "No",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "96.35",
         "6766.95",
         "No"
        ],
        [
         "31",
         "4929-XIHVW",
         "Male",
         "1",
         "Yes",
         "No",
         "2",
         "Yes",
         "No",
         "Fiber optic",
         "No",
         "No",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Credit card (automatic)",
         "95.5",
         "181.65",
         "No"
        ],
        [
         "32",
         "6827-IEAUQ",
         "Female",
         "0",
         "Yes",
         "Yes",
         "27",
         "Yes",
         "No",
         "DSL",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "No",
         "No",
         "One year",
         "No",
         "Mailed check",
         "66.15",
         "1874.45",
         "No"
        ],
        [
         "33",
         "7310-EGVHZ",
         "Male",
         "0",
         "No",
         "No",
         "1",
         "Yes",
         "No",
         "No",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "Month-to-month",
         "No",
         "Bank transfer (automatic)",
         "20.2",
         "20.2",
         "No"
        ],
        [
         "34",
         "3413-BMNZE",
         "Male",
         "1",
         "No",
         "No",
         "1",
         "Yes",
         "No",
         "DSL",
         "No",
         "No",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "No",
         "Bank transfer (automatic)",
         "45.25",
         "45.25",
         "No"
        ],
        [
         "35",
         "6234-RAAPL",
         "Female",
         "0",
         "Yes",
         "Yes",
         "72",
         "Yes",
         "Yes",
         "Fiber optic",
         "Yes",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "No",
         "Two year",
         "No",
         "Bank transfer (automatic)",
         "99.9",
         "7251.7",
         "No"
        ],
        [
         "36",
         "6047-YHPVI",
         "Male",
         "0",
         "No",
         "No",
         "5",
         "Yes",
         "No",
         "Fiber optic",
         "No",
         "No",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "69.7",
         "316.9",
         "Yes"
        ],
        [
         "37",
         "6572-ADKRS",
         "Female",
         "0",
         "No",
         "No",
         "46",
         "Yes",
         "No",
         "Fiber optic",
         "No",
         "No",
         "Yes",
         "No",
         "No",
         "No",
         "Month-to-month",
         "Yes",
         "Credit card (automatic)",
         "74.8",
         "3548.3",
         "No"
        ],
        [
         "38",
         "5380-WJKOV",
         "Male",
         "0",
         "No",
         "No",
         "34",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "Yes",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "106.35",
         "3549.25",
         "Yes"
        ],
        [
         "39",
         "8168-UQWWF",
         "Female",
         "0",
         "No",
         "No",
         "11",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "No",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "Month-to-month",
         "Yes",
         "Bank transfer (automatic)",
         "97.85",
         "1105.4",
         "Yes"
        ],
        [
         "40",
         "8865-TNMNX",
         "Male",
         "0",
         "Yes",
         "Yes",
         "10",
         "Yes",
         "No",
         "DSL",
         "No",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "One year",
         "No",
         "Mailed check",
         "49.55",
         "475.7",
         "No"
        ],
        [
         "41",
         "9489-DEDVP",
         "Female",
         "0",
         "Yes",
         "Yes",
         "70",
         "Yes",
         "Yes",
         "DSL",
         "Yes",
         "Yes",
         "No",
         "No",
         "Yes",
         "No",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "69.2",
         "4872.35",
         "No"
        ],
        [
         "42",
         "9867-JCZSP",
         "Female",
         "0",
         "Yes",
         "Yes",
         "17",
         "Yes",
         "No",
         "No",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "No internet service",
         "One year",
         "No",
         "Mailed check",
         "20.75",
         "418.25",
         "No"
        ],
        [
         "43",
         "4671-VJLCL",
         "Female",
         "0",
         "No",
         "No",
         "63",
         "Yes",
         "Yes",
         "DSL",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "Yes",
         "No",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "79.85",
         "4861.45",
         "No"
        ],
        [
         "44",
         "4080-IIARD",
         "Female",
         "0",
         "Yes",
         "No",
         "13",
         "Yes",
         "Yes",
         "DSL",
         "Yes",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "No",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "76.2",
         "981.45",
         "No"
        ],
        [
         "45",
         "3714-NTNFO",
         "Female",
         "0",
         "No",
         "No",
         "49",
         "Yes",
         "Yes",
         "Fiber optic",
         "No",
         "No",
         "No",
         "No",
         "No",
         "Yes",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "84.5",
         "3906.7",
         "No"
        ],
        [
         "46",
         "5948-UJZLF",
         "Male",
         "0",
         "No",
         "No",
         "2",
         "Yes",
         "No",
         "DSL",
         "No",
         "Yes",
         "No",
         "No",
         "No",
         "No",
         "Month-to-month",
         "No",
         "Mailed check",
         "49.25",
         "97",
         "No"
        ],
        [
         "47",
         "7760-OYPDY",
         "Female",
         "0",
         "No",
         "No",
         "2",
         "Yes",
         "No",
         "Fiber optic",
         "No",
         "No",
         "No",
         "No",
         "Yes",
         "No",
         "Month-to-month",
         "Yes",
         "Electronic check",
         "80.65",
         "144.15",
         "Yes"
        ],
        [
         "48",
         "7639-LIAYI",
         "Male",
         "0",
         "No",
         "No",
         "52",
         "Yes",
         "Yes",
         "DSL",
         "Yes",
         "No",
         "No",
         "Yes",
         "Yes",
         "Yes",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "79.75",
         "4217.8",
         "No"
        ],
        [
         "49",
         "2954-PIBKO",
         "Female",
         "0",
         "Yes",
         "Yes",
         "69",
         "Yes",
         "Yes",
         "DSL",
         "Yes",
         "No",
         "Yes",
         "Yes",
         "No",
         "No",
         "Two year",
         "Yes",
         "Credit card (automatic)",
         "64.15",
         "4254.1",
         "No"
        ]
       ],
       "shape": {
        "columns": 21,
        "rows": 7043
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>customerID</th>\n",
       "      <th>gender</th>\n",
       "      <th>SeniorCitizen</th>\n",
       "      <th>Partner</th>\n",
       "      <th>Dependents</th>\n",
       "      <th>tenure</th>\n",
       "      <th>PhoneService</th>\n",
       "      <th>MultipleLines</th>\n",
       "      <th>InternetService</th>\n",
       "      <th>OnlineSecurity</th>\n",
       "      <th>...</th>\n",
       "      <th>DeviceProtection</th>\n",
       "      <th>TechSupport</th>\n",
       "      <th>StreamingTV</th>\n",
       "      <th>StreamingMovies</th>\n",
       "      <th>Contract</th>\n",
       "      <th>PaperlessBilling</th>\n",
       "      <th>PaymentMethod</th>\n",
       "      <th>MonthlyCharges</th>\n",
       "      <th>TotalCharges</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>7590-VHVEG</td>\n",
       "      <td>Female</td>\n",
       "      <td>0</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>1</td>\n",
       "      <td>No</td>\n",
       "      <td>No phone service</td>\n",
       "      <td>DSL</td>\n",
       "      <td>No</td>\n",
       "      <td>...</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>Month-to-month</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Electronic check</td>\n",
       "      <td>29.85</td>\n",
       "      <td>29.85</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5575-GNVDE</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>34</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>DSL</td>\n",
       "      <td>Yes</td>\n",
       "      <td>...</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>One year</td>\n",
       "      <td>No</td>\n",
       "      <td>Mailed check</td>\n",
       "      <td>56.95</td>\n",
       "      <td>1889.5</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3668-QPYBK</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>2</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>DSL</td>\n",
       "      <td>Yes</td>\n",
       "      <td>...</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>Month-to-month</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Mailed check</td>\n",
       "      <td>53.85</td>\n",
       "      <td>108.15</td>\n",
       "      <td>Yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7795-CFOCW</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>45</td>\n",
       "      <td>No</td>\n",
       "      <td>No phone service</td>\n",
       "      <td>DSL</td>\n",
       "      <td>Yes</td>\n",
       "      <td>...</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>One year</td>\n",
       "      <td>No</td>\n",
       "      <td>Bank transfer (automatic)</td>\n",
       "      <td>42.30</td>\n",
       "      <td>1840.75</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>9237-HQITU</td>\n",
       "      <td>Female</td>\n",
       "      <td>0</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>2</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>Fiber optic</td>\n",
       "      <td>No</td>\n",
       "      <td>...</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>Month-to-month</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Electronic check</td>\n",
       "      <td>70.70</td>\n",
       "      <td>151.65</td>\n",
       "      <td>Yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7038</th>\n",
       "      <td>6840-RESVB</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>24</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>DSL</td>\n",
       "      <td>Yes</td>\n",
       "      <td>...</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>One year</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Mailed check</td>\n",
       "      <td>84.80</td>\n",
       "      <td>1990.5</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7039</th>\n",
       "      <td>2234-XADUH</td>\n",
       "      <td>Female</td>\n",
       "      <td>0</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>72</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Fiber optic</td>\n",
       "      <td>No</td>\n",
       "      <td>...</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>One year</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Credit card (automatic)</td>\n",
       "      <td>103.20</td>\n",
       "      <td>7362.9</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7040</th>\n",
       "      <td>4801-JZAZL</td>\n",
       "      <td>Female</td>\n",
       "      <td>0</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>11</td>\n",
       "      <td>No</td>\n",
       "      <td>No phone service</td>\n",
       "      <td>DSL</td>\n",
       "      <td>Yes</td>\n",
       "      <td>...</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>Month-to-month</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Electronic check</td>\n",
       "      <td>29.60</td>\n",
       "      <td>346.45</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7041</th>\n",
       "      <td>8361-LTMKD</td>\n",
       "      <td>Male</td>\n",
       "      <td>1</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>4</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Fiber optic</td>\n",
       "      <td>No</td>\n",
       "      <td>...</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>Month-to-month</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Mailed check</td>\n",
       "      <td>74.40</td>\n",
       "      <td>306.6</td>\n",
       "      <td>Yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7042</th>\n",
       "      <td>3186-AJIEK</td>\n",
       "      <td>Male</td>\n",
       "      <td>0</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>66</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>Fiber optic</td>\n",
       "      <td>Yes</td>\n",
       "      <td>...</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Two year</td>\n",
       "      <td>Yes</td>\n",
       "      <td>Bank transfer (automatic)</td>\n",
       "      <td>105.65</td>\n",
       "      <td>6844.5</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7043 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      customerID  gender  SeniorCitizen Partner Dependents  tenure  \\\n",
       "0     7590-VHVEG  Female              0     Yes         No       1   \n",
       "1     5575-GNVDE    Male              0      No         No      34   \n",
       "2     3668-QPYBK    Male              0      No         No       2   \n",
       "3     7795-CFOCW    Male              0      No         No      45   \n",
       "4     9237-HQITU  Female              0      No         No       2   \n",
       "...          ...     ...            ...     ...        ...     ...   \n",
       "7038  6840-RESVB    Male              0     Yes        Yes      24   \n",
       "7039  2234-XADUH  Female              0     Yes        Yes      72   \n",
       "7040  4801-JZAZL  Female              0     Yes        Yes      11   \n",
       "7041  8361-LTMKD    Male              1     Yes         No       4   \n",
       "7042  3186-AJIEK    Male              0      No         No      66   \n",
       "\n",
       "     PhoneService     MultipleLines InternetService OnlineSecurity  ...  \\\n",
       "0              No  No phone service             DSL             No  ...   \n",
       "1             Yes                No             DSL            Yes  ...   \n",
       "2             Yes                No             DSL            Yes  ...   \n",
       "3              No  No phone service             DSL            Yes  ...   \n",
       "4             Yes                No     Fiber optic             No  ...   \n",
       "...           ...               ...             ...            ...  ...   \n",
       "7038          Yes               Yes             DSL            Yes  ...   \n",
       "7039          Yes               Yes     Fiber optic             No  ...   \n",
       "7040           No  No phone service             DSL            Yes  ...   \n",
       "7041          Yes               Yes     Fiber optic             No  ...   \n",
       "7042          Yes                No     Fiber optic            Yes  ...   \n",
       "\n",
       "     DeviceProtection TechSupport StreamingTV StreamingMovies        Contract  \\\n",
       "0                  No          No          No              No  Month-to-month   \n",
       "1                 Yes          No          No              No        One year   \n",
       "2                  No          No          No              No  Month-to-month   \n",
       "3                 Yes         Yes          No              No        One year   \n",
       "4                  No          No          No              No  Month-to-month   \n",
       "...               ...         ...         ...             ...             ...   \n",
       "7038              Yes         Yes         Yes             Yes        One year   \n",
       "7039              Yes          No         Yes             Yes        One year   \n",
       "7040               No          No          No              No  Month-to-month   \n",
       "7041               No          No          No              No  Month-to-month   \n",
       "7042              Yes         Yes         Yes             Yes        Two year   \n",
       "\n",
       "     PaperlessBilling              PaymentMethod MonthlyCharges  TotalCharges  \\\n",
       "0                 Yes           Electronic check          29.85         29.85   \n",
       "1                  No               Mailed check          56.95        1889.5   \n",
       "2                 Yes               Mailed check          53.85        108.15   \n",
       "3                  No  Bank transfer (automatic)          42.30       1840.75   \n",
       "4                 Yes           Electronic check          70.70        151.65   \n",
       "...               ...                        ...            ...           ...   \n",
       "7038              Yes               Mailed check          84.80        1990.5   \n",
       "7039              Yes    Credit card (automatic)         103.20        7362.9   \n",
       "7040              Yes           Electronic check          29.60        346.45   \n",
       "7041              Yes               Mailed check          74.40         306.6   \n",
       "7042              Yes  Bank transfer (automatic)         105.65        6844.5   \n",
       "\n",
       "     Churn  \n",
       "0       No  \n",
       "1       No  \n",
       "2      Yes  \n",
       "3       No  \n",
       "4      Yes  \n",
       "...    ...  \n",
       "7038    No  \n",
       "7039    No  \n",
       "7040    No  \n",
       "7041   Yes  \n",
       "7042    No  \n",
       "\n",
       "[7043 rows x 21 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"data/churn_data.csv\")\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### LLM Setup\n",
    "\n",
    "Run the code to set up your OpenAI API Key and set up key inputs for the LLM model creation and H2O AutoML model creation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ChatOpenAI(client=<openai.resources.chat.completions.completions.Completions object at 0x7f8f19ac6f50>, async_client=<openai.resources.chat.completions.completions.AsyncCompletions object at 0x7f8f19aed8a0>, root_client=<openai.OpenAI object at 0x7f8eb8460520>, root_async_client=<openai.AsyncOpenAI object at 0x7f8f19ac6fb0>, model_name='gpt-4o-mini', model_kwargs={}, openai_api_key=SecretStr('**********'))"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.environ['OPENAI_API_KEY'] = \"YOUR_OPENAI_API_KEY\"\n",
    "os.environ[\"OPENAI_API_KEY\"] = yaml.safe_load(open('../credentials.yml'))['openai']\n",
    "\n",
    "# Define constants for model, logging, and paths\n",
    "MODEL    = \"gpt-4o-mini\"\n",
    "LOG      = True\n",
    "LOG_PATH = \"logs/\"\n",
    "MODEL_PATH = \"h2o_models/\"\n",
    "\n",
    "# Initialize the language model\n",
    "llm = ChatOpenAI(model=MODEL)\n",
    "llm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Create the Agent\n",
    "\n",
    "Run the code to create the AI Machine Learning Agent that makes 30+ machine learning models in 30 seconds.\n",
    "\n",
    "- `model` - The LLM to use.\n",
    "- `log` and `log_path` - Set to `True` to log the Python function (pipeline) to a file in the `LOG_PATH` directory. (/logs by default)\n",
    "- `model_directory` - The directory to save the models. (/models by default)\n",
    "- `enable_mlflow` - Set to `True` to enable MLflow tracking. This is required to complete [the MLflowToolsAgent tutorial](/examples/ml_agents/mlflow_tools_agent.ipynb)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAIrCAIAAABu+MUIAAAAAXNSR0IArs4c6QAAIABJREFUeJzs3WdYE9nbBvCTBgkh9N4FkWIDATsq9i6yiqLY0LXXVXct6Fqxt7Vhx7agWLA3RFRQFHRBFERFEOkk9JKQ9n6Y/Wd96WrITIbnd/GBTCYzT5Lh5kw7hyKVShEAADQ/Kt4FAABaCogbAICCQNwAABQE4gYAoCAQNwAABYG4AQAoCB3vApSYVILyvgjKS4WVpWKxSFrNl+BdUZOoMKlMNSpbk87Romsbq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EikejTp09hYWGlpaVeXl5qamoGBgb37t178eIFNjhvYGCgSCSyt7evsVIC3vpw+fJliUQyduxYvAshqBo3VVIolPq+66qqqrVr11pZWc2ZM6dDhw6RkZExMTEDBgyg0WihoaHZ2dlSqfTz588nT5588+aNr69vx44dEUIfPnyIioqqqKjo0KGDSCS6f/++WCwWCoWhoaHR0dGVlZU9evTADqCEhIQ4ODg4OTkVFRXduXOnT58+2MlpkUh08eJFFxeX2tubTBO39oMHD8pra1dVVSXggLHyiZtnz56dP39+9uzZ7dq1Qwg5OTmFh4e/evWqf//+9V1zTKfT3d3dS0pKoqKiYmJiSktL3d3d7e3tGQxGly5d0tPTb926FRsba2Njs3LlSmwntlWrVhoaGgkJCc+fP+dyua1bt/78+bOXlxeLxTI3N7e1tX337t3Dhw8/fPjQqlWrvn371t6bJVrcVFdXb9u2Da4fa0Dte7jr+66PHz/+5s2b9evXa2lp0el0Ozu70NDQiooKV1fX0NBQIyOjjx8/Yu2LcePGYRdzYL3/5ebmPnv2bMSIETY2NhKJ5NatW9HR0SYmJosWLXr37p1UKm3bti2VSv2ZuGnK1h4XF9e6desVK1bIZWsnZtxQ6utDC+u/UuH1/D+FhYXa2tpyvIyYaN1r/frrr3PmzOnUqRPehRDXz3SvJTN27NhBgwbNmDHjx14ulUolEoly9c5FzO61mjf/li9fXuegzl27dl26dGnDr5VKpeS+ZeHIkSNubm6QNcRHoVD4fD528XEDswUFBd26dav2dA6Hc/LkyeYsUGk0b9ysWLGizoNYTcldCoVC4jviXr169erVq6NHj+JdCGgSNpstEomkUmkD//+8vLzqPBemLD1kKwBxd6aqq6spFIp8+wYlzs6Uq6srdpU23oUQnVx2plogYu5METd3BQKBsowG8b2WLl168uRJyBqlU1VVVfsUCmg64lhkh7MAACAASURBVMaNiooKKbs937Rpk7u7e4cOHfAuBHw3FoslkUhwP4WivOo9doP7cRMCNgV/3vnz59XU1KADraaj0+mE2hIIVUwDiHkerd64abi3IQW4deuWi4sL1m0gOTx//vz58+cHDh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AAF4CFc0+rgAAAAtJREFUcQMA8JL/B/2rTmDrA3PZAAAAAElFTkSuQmCC",
      "text/plain": [
       "<ai_data_science_team.ml_agents.h2o_ml_agent.H2OMLAgent object at 0x7feef87e4f40>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ml_agent = H2OMLAgent(\n",
    "    model=llm, \n",
    "    log=True, \n",
    "    log_path=LOG_PATH,\n",
    "    model_directory=MODEL_PATH, \n",
    "    enable_mlflow=True, # Use this if you wish to log to MLflow \n",
    ")\n",
    "ml_agent"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Run the Agent\n",
    "\n",
    "Run the code to run the AI Machine Learning Agent and create the models."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "---H2O ML AGENT----\n",
      "    * RECOMMEND MACHINE LEARNING STEPS\n",
      "    * CREATE H2O AUTOML CODE\n",
      "      File saved to: logs/h2o_automl.py\n",
      "    * EXECUTING AGENT CODE\n",
      "Checking whether there is an H2O instance running at http://localhost:54321. connected.\n",
      "Warning: Your H2O cluster version is (10 months and 4 days) old.  There may be a newer version available.\n",
      "Please download and install the latest version from: https://h2o-release.s3.amazonaws.com/h2o/latest_stable.html\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<style>\n",
       "\n",
       "#h2o-table-1.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-1 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-1 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-1 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-1 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-1 .h2o-table th,\n",
       "#h2o-table-1 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-1 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-1\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption></caption>\n",
       "    <thead></thead>\n",
       "    <tbody><tr><td>H2O_cluster_uptime:</td>\n",
       "<td>7 hours 14 mins</td></tr>\n",
       "<tr><td>H2O_cluster_timezone:</td>\n",
       "<td>America/New_York</td></tr>\n",
       "<tr><td>H2O_data_parsing_timezone:</td>\n",
       "<td>UTC</td></tr>\n",
       "<tr><td>H2O_cluster_version:</td>\n",
       "<td>3.46.0.1</td></tr>\n",
       "<tr><td>H2O_cluster_version_age:</td>\n",
       "<td>10 months and 4 days</td></tr>\n",
       "<tr><td>H2O_cluster_name:</td>\n",
       "<td>H2O_from_python_mdancho_ag7ena</td></tr>\n",
       "<tr><td>H2O_cluster_total_nodes:</td>\n",
       "<td>1</td></tr>\n",
       "<tr><td>H2O_cluster_free_memory:</td>\n",
       "<td>11.99 Gb</td></tr>\n",
       "<tr><td>H2O_cluster_total_cores:</td>\n",
       "<td>14</td></tr>\n",
       "<tr><td>H2O_cluster_allowed_cores:</td>\n",
       "<td>14</td></tr>\n",
       "<tr><td>H2O_cluster_status:</td>\n",
       "<td>locked, healthy</td></tr>\n",
       "<tr><td>H2O_connection_url:</td>\n",
       "<td>http://localhost:54321</td></tr>\n",
       "<tr><td>H2O_connection_proxy:</td>\n",
       "<td>{\"http\": null, \"https\": null}</td></tr>\n",
       "<tr><td>H2O_internal_security:</td>\n",
       "<td>False</td></tr>\n",
       "<tr><td>Python_version:</td>\n",
       "<td>3.10.13 final</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n"
      ],
      "text/plain": [
       "--------------------------  ------------------------------\n",
       "H2O_cluster_uptime:         7 hours 14 mins\n",
       "H2O_cluster_timezone:       America/New_York\n",
       "H2O_data_parsing_timezone:  UTC\n",
       "H2O_cluster_version:        3.46.0.1\n",
       "H2O_cluster_version_age:    10 months and 4 days\n",
       "H2O_cluster_name:           H2O_from_python_mdancho_ag7ena\n",
       "H2O_cluster_total_nodes:    1\n",
       "H2O_cluster_free_memory:    11.99 Gb\n",
       "H2O_cluster_total_cores:    14\n",
       "H2O_cluster_allowed_cores:  14\n",
       "H2O_cluster_status:         locked, healthy\n",
       "H2O_connection_url:         http://localhost:54321\n",
       "H2O_connection_proxy:       {\"http\": null, \"https\": null}\n",
       "H2O_internal_security:      False\n",
       "Python_version:             3.10.13 final\n",
       "--------------------------  ------------------------------"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Parse progress: |████████████████████████████████████████████████████████████████| (done) 100%\n",
      "AutoML progress: |\n",
      "18:27:21.352: Stopping tolerance set by the user is < 70% of the recommended default of 0.011915743770127944, so models may take a long time to converge or may not converge at all.\n",
      "\n",
      "███████████████████████████████████████████████████████████████| (done) 100%\n",
      "    * REPORT AGENT OUTPUTS\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/h2o/frame.py:1983: H2ODependencyWarning: Converting H2O frame to pandas dataframe using single-thread.  For faster conversion using multi-thread, install datatable (for Python 3.9 or lower), or polars and pyarrow (for Python 3.10 or above) and activate it using:\n",
      "\n",
      "with h2o.utils.threading.local_context(polars_enabled=True, datatable_enabled=True):\n",
      "    pandas_df = h2o_df.as_data_frame()\n",
      "\n",
      "  warnings.warn(\"Converting H2O frame to pandas dataframe using single-thread.  For faster conversion using\"\n"
     ]
    }
   ],
   "source": [
    "\n",
    "ml_agent.invoke_agent(\n",
    "    data_raw=df.drop(columns=[\"customerID\"]),\n",
    "    user_instructions=\"Please do classification on 'Churn'. Use a max runtime of 30 seconds.\",\n",
    "    target_variable=\"Churn\"\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Leaderboard\n",
    "\n",
    "The leaderboard shows the ML models created by the AI Machine Learning Agent ranked by various ML metrics."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>model_id</th>\n",
       "      <th>auc</th>\n",
       "      <th>logloss</th>\n",
       "      <th>aucpr</th>\n",
       "      <th>mean_per_class_error</th>\n",
       "      <th>rmse</th>\n",
       "      <th>mse</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>StackedEnsemble_BestOfFamily_2_AutoML_2_202501...</td>\n",
       "      <td>0.850006</td>\n",
       "      <td>0.410950</td>\n",
       "      <td>0.666045</td>\n",
       "      <td>0.228422</td>\n",
       "      <td>0.365294</td>\n",
       "      <td>0.133439</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>StackedEnsemble_BestOfFamily_1_AutoML_2_202501...</td>\n",
       "      <td>0.849827</td>\n",
       "      <td>0.411221</td>\n",
       "      <td>0.665194</td>\n",
       "      <td>0.226759</td>\n",
       "      <td>0.365353</td>\n",
       "      <td>0.133483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>StackedEnsemble_AllModels_2_AutoML_2_20250117_...</td>\n",
       "      <td>0.849722</td>\n",
       "      <td>0.411135</td>\n",
       "      <td>0.666036</td>\n",
       "      <td>0.224464</td>\n",
       "      <td>0.365316</td>\n",
       "      <td>0.133456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>StackedEnsemble_BestOfFamily_4_AutoML_2_202501...</td>\n",
       "      <td>0.849691</td>\n",
       "      <td>0.410955</td>\n",
       "      <td>0.667338</td>\n",
       "      <td>0.230516</td>\n",
       "      <td>0.365232</td>\n",
       "      <td>0.133394</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>StackedEnsemble_AllModels_1_AutoML_2_20250117_...</td>\n",
       "      <td>0.849660</td>\n",
       "      <td>0.411465</td>\n",
       "      <td>0.664531</td>\n",
       "      <td>0.230069</td>\n",
       "      <td>0.365506</td>\n",
       "      <td>0.133594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>StackedEnsemble_BestOfFamily_3_AutoML_2_202501...</td>\n",
       "      <td>0.849502</td>\n",
       "      <td>0.411334</td>\n",
       "      <td>0.667723</td>\n",
       "      <td>0.226358</td>\n",
       "      <td>0.365353</td>\n",
       "      <td>0.133483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>StackedEnsemble_AllModels_3_AutoML_2_20250117_...</td>\n",
       "      <td>0.848822</td>\n",
       "      <td>0.411923</td>\n",
       "      <td>0.664691</td>\n",
       "      <td>0.227170</td>\n",
       "      <td>0.365783</td>\n",
       "      <td>0.133797</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>GBM_1_AutoML_2_20250117_182721</td>\n",
       "      <td>0.847581</td>\n",
       "      <td>0.414998</td>\n",
       "      <td>0.662772</td>\n",
       "      <td>0.229477</td>\n",
       "      <td>0.367105</td>\n",
       "      <td>0.134766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_1</td>\n",
       "      <td>0.845952</td>\n",
       "      <td>0.415312</td>\n",
       "      <td>0.660968</td>\n",
       "      <td>0.236311</td>\n",
       "      <td>0.367351</td>\n",
       "      <td>0.134947</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_7</td>\n",
       "      <td>0.845670</td>\n",
       "      <td>0.419965</td>\n",
       "      <td>0.658424</td>\n",
       "      <td>0.238885</td>\n",
       "      <td>0.368094</td>\n",
       "      <td>0.135493</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>GLM_1_AutoML_2_20250117_182721</td>\n",
       "      <td>0.845134</td>\n",
       "      <td>0.417470</td>\n",
       "      <td>0.652031</td>\n",
       "      <td>0.234092</td>\n",
       "      <td>0.368076</td>\n",
       "      <td>0.135480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_5</td>\n",
       "      <td>0.844876</td>\n",
       "      <td>0.417112</td>\n",
       "      <td>0.655436</td>\n",
       "      <td>0.239689</td>\n",
       "      <td>0.368512</td>\n",
       "      <td>0.135801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_6</td>\n",
       "      <td>0.844580</td>\n",
       "      <td>0.416563</td>\n",
       "      <td>0.661210</td>\n",
       "      <td>0.232717</td>\n",
       "      <td>0.368033</td>\n",
       "      <td>0.135448</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>GBM_grid_1_AutoML_2_20250117_182721_model_1</td>\n",
       "      <td>0.843988</td>\n",
       "      <td>0.419304</td>\n",
       "      <td>0.655764</td>\n",
       "      <td>0.232006</td>\n",
       "      <td>0.368750</td>\n",
       "      <td>0.135977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>GBM_5_AutoML_2_20250117_182721</td>\n",
       "      <td>0.842354</td>\n",
       "      <td>0.421817</td>\n",
       "      <td>0.655105</td>\n",
       "      <td>0.233498</td>\n",
       "      <td>0.370081</td>\n",
       "      <td>0.136960</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>GBM_2_AutoML_2_20250117_182721</td>\n",
       "      <td>0.841591</td>\n",
       "      <td>0.422390</td>\n",
       "      <td>0.656352</td>\n",
       "      <td>0.237992</td>\n",
       "      <td>0.370223</td>\n",
       "      <td>0.137065</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>XGBoost_3_AutoML_2_20250117_182721</td>\n",
       "      <td>0.838633</td>\n",
       "      <td>0.481533</td>\n",
       "      <td>0.649947</td>\n",
       "      <td>0.235944</td>\n",
       "      <td>0.401041</td>\n",
       "      <td>0.160834</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_3</td>\n",
       "      <td>0.837571</td>\n",
       "      <td>0.427998</td>\n",
       "      <td>0.648548</td>\n",
       "      <td>0.237621</td>\n",
       "      <td>0.372482</td>\n",
       "      <td>0.138743</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>XRT_1_AutoML_2_20250117_182721</td>\n",
       "      <td>0.837332</td>\n",
       "      <td>0.430208</td>\n",
       "      <td>0.648442</td>\n",
       "      <td>0.241145</td>\n",
       "      <td>0.374037</td>\n",
       "      <td>0.139904</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>GBM_3_AutoML_2_20250117_182721</td>\n",
       "      <td>0.835770</td>\n",
       "      <td>0.430271</td>\n",
       "      <td>0.642863</td>\n",
       "      <td>0.244853</td>\n",
       "      <td>0.373325</td>\n",
       "      <td>0.139372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_2</td>\n",
       "      <td>0.835729</td>\n",
       "      <td>0.430062</td>\n",
       "      <td>0.647138</td>\n",
       "      <td>0.249140</td>\n",
       "      <td>0.373906</td>\n",
       "      <td>0.139806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>GBM_grid_1_AutoML_2_20250117_182721_model_4</td>\n",
       "      <td>0.834568</td>\n",
       "      <td>0.433872</td>\n",
       "      <td>0.644549</td>\n",
       "      <td>0.240181</td>\n",
       "      <td>0.375531</td>\n",
       "      <td>0.141023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>GBM_4_AutoML_2_20250117_182721</td>\n",
       "      <td>0.831271</td>\n",
       "      <td>0.438734</td>\n",
       "      <td>0.637577</td>\n",
       "      <td>0.245945</td>\n",
       "      <td>0.376506</td>\n",
       "      <td>0.141757</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>GBM_grid_1_AutoML_2_20250117_182721_model_2</td>\n",
       "      <td>0.830516</td>\n",
       "      <td>0.442387</td>\n",
       "      <td>0.631798</td>\n",
       "      <td>0.248531</td>\n",
       "      <td>0.377900</td>\n",
       "      <td>0.142809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>XGBoost_grid_1_AutoML_2_20250117_182721_model_4</td>\n",
       "      <td>0.826230</td>\n",
       "      <td>0.457860</td>\n",
       "      <td>0.630066</td>\n",
       "      <td>0.249123</td>\n",
       "      <td>0.382691</td>\n",
       "      <td>0.146453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>GBM_grid_1_AutoML_2_20250117_182721_model_3</td>\n",
       "      <td>0.826118</td>\n",
       "      <td>0.512924</td>\n",
       "      <td>0.630421</td>\n",
       "      <td>0.247201</td>\n",
       "      <td>0.392623</td>\n",
       "      <td>0.154153</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>XGBoost_1_AutoML_2_20250117_182721</td>\n",
       "      <td>0.823323</td>\n",
       "      <td>0.501767</td>\n",
       "      <td>0.624059</td>\n",
       "      <td>0.253169</td>\n",
       "      <td>0.407095</td>\n",
       "      <td>0.165726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>DRF_1_AutoML_2_20250117_182721</td>\n",
       "      <td>0.821350</td>\n",
       "      <td>0.496097</td>\n",
       "      <td>0.615213</td>\n",
       "      <td>0.267490</td>\n",
       "      <td>0.386310</td>\n",
       "      <td>0.149236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>XGBoost_2_AutoML_2_20250117_182721</td>\n",
       "      <td>0.815923</td>\n",
       "      <td>0.515674</td>\n",
       "      <td>0.602748</td>\n",
       "      <td>0.261969</td>\n",
       "      <td>0.409996</td>\n",
       "      <td>0.168096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>GBM_grid_1_AutoML_2_20250117_182721_model_5</td>\n",
       "      <td>0.789088</td>\n",
       "      <td>0.552519</td>\n",
       "      <td>0.551880</td>\n",
       "      <td>0.271343</td>\n",
       "      <td>0.429957</td>\n",
       "      <td>0.184863</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                             model_id       auc   logloss  \\\n",
       "0   StackedEnsemble_BestOfFamily_2_AutoML_2_202501...  0.850006  0.410950   \n",
       "1   StackedEnsemble_BestOfFamily_1_AutoML_2_202501...  0.849827  0.411221   \n",
       "2   StackedEnsemble_AllModels_2_AutoML_2_20250117_...  0.849722  0.411135   \n",
       "3   StackedEnsemble_BestOfFamily_4_AutoML_2_202501...  0.849691  0.410955   \n",
       "4   StackedEnsemble_AllModels_1_AutoML_2_20250117_...  0.849660  0.411465   \n",
       "5   StackedEnsemble_BestOfFamily_3_AutoML_2_202501...  0.849502  0.411334   \n",
       "6   StackedEnsemble_AllModels_3_AutoML_2_20250117_...  0.848822  0.411923   \n",
       "7                      GBM_1_AutoML_2_20250117_182721  0.847581  0.414998   \n",
       "8     XGBoost_grid_1_AutoML_2_20250117_182721_model_1  0.845952  0.415312   \n",
       "9     XGBoost_grid_1_AutoML_2_20250117_182721_model_7  0.845670  0.419965   \n",
       "10                     GLM_1_AutoML_2_20250117_182721  0.845134  0.417470   \n",
       "11    XGBoost_grid_1_AutoML_2_20250117_182721_model_5  0.844876  0.417112   \n",
       "12    XGBoost_grid_1_AutoML_2_20250117_182721_model_6  0.844580  0.416563   \n",
       "13        GBM_grid_1_AutoML_2_20250117_182721_model_1  0.843988  0.419304   \n",
       "14                     GBM_5_AutoML_2_20250117_182721  0.842354  0.421817   \n",
       "15                     GBM_2_AutoML_2_20250117_182721  0.841591  0.422390   \n",
       "16                 XGBoost_3_AutoML_2_20250117_182721  0.838633  0.481533   \n",
       "17    XGBoost_grid_1_AutoML_2_20250117_182721_model_3  0.837571  0.427998   \n",
       "18                     XRT_1_AutoML_2_20250117_182721  0.837332  0.430208   \n",
       "19                     GBM_3_AutoML_2_20250117_182721  0.835770  0.430271   \n",
       "20    XGBoost_grid_1_AutoML_2_20250117_182721_model_2  0.835729  0.430062   \n",
       "21        GBM_grid_1_AutoML_2_20250117_182721_model_4  0.834568  0.433872   \n",
       "22                     GBM_4_AutoML_2_20250117_182721  0.831271  0.438734   \n",
       "23        GBM_grid_1_AutoML_2_20250117_182721_model_2  0.830516  0.442387   \n",
       "24    XGBoost_grid_1_AutoML_2_20250117_182721_model_4  0.826230  0.457860   \n",
       "25        GBM_grid_1_AutoML_2_20250117_182721_model_3  0.826118  0.512924   \n",
       "26                 XGBoost_1_AutoML_2_20250117_182721  0.823323  0.501767   \n",
       "27                     DRF_1_AutoML_2_20250117_182721  0.821350  0.496097   \n",
       "28                 XGBoost_2_AutoML_2_20250117_182721  0.815923  0.515674   \n",
       "29        GBM_grid_1_AutoML_2_20250117_182721_model_5  0.789088  0.552519   \n",
       "\n",
       "       aucpr  mean_per_class_error      rmse       mse  \n",
       "0   0.666045              0.228422  0.365294  0.133439  \n",
       "1   0.665194              0.226759  0.365353  0.133483  \n",
       "2   0.666036              0.224464  0.365316  0.133456  \n",
       "3   0.667338              0.230516  0.365232  0.133394  \n",
       "4   0.664531              0.230069  0.365506  0.133594  \n",
       "5   0.667723              0.226358  0.365353  0.133483  \n",
       "6   0.664691              0.227170  0.365783  0.133797  \n",
       "7   0.662772              0.229477  0.367105  0.134766  \n",
       "8   0.660968              0.236311  0.367351  0.134947  \n",
       "9   0.658424              0.238885  0.368094  0.135493  \n",
       "10  0.652031              0.234092  0.368076  0.135480  \n",
       "11  0.655436              0.239689  0.368512  0.135801  \n",
       "12  0.661210              0.232717  0.368033  0.135448  \n",
       "13  0.655764              0.232006  0.368750  0.135977  \n",
       "14  0.655105              0.233498  0.370081  0.136960  \n",
       "15  0.656352              0.237992  0.370223  0.137065  \n",
       "16  0.649947              0.235944  0.401041  0.160834  \n",
       "17  0.648548              0.237621  0.372482  0.138743  \n",
       "18  0.648442              0.241145  0.374037  0.139904  \n",
       "19  0.642863              0.244853  0.373325  0.139372  \n",
       "20  0.647138              0.249140  0.373906  0.139806  \n",
       "21  0.644549              0.240181  0.375531  0.141023  \n",
       "22  0.637577              0.245945  0.376506  0.141757  \n",
       "23  0.631798              0.248531  0.377900  0.142809  \n",
       "24  0.630066              0.249123  0.382691  0.146453  \n",
       "25  0.630421              0.247201  0.392623  0.154153  \n",
       "26  0.624059              0.253169  0.407095  0.165726  \n",
       "27  0.615213              0.267490  0.386310  0.149236  \n",
       "28  0.602748              0.261969  0.409996  0.168096  \n",
       "29  0.551880              0.271343  0.429957  0.184863  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Retrieve and display the leaderboard of models\n",
    "ml_agent.get_leaderboard()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Get The AI Generated Python Code\n",
    "\n",
    "The AI Machine Learning Agent will generate Python code that was used to create the models."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "```python\n",
       "# Disclaimer: This function was generated by AI. Please review before using.\n",
       "# Agent Name: h2o_ml_agent\n",
       "# Time Created: 2025-01-17 18:27:20\n",
       "\n",
       "def h2o_automl(data_raw, model_directory=None, log_path=None):\n",
       "    import h2o\n",
       "    from h2o.automl import H2OAutoML\n",
       "    import pandas as pd\n",
       "\n",
       "\n",
       "\n",
       "    # Initialize or connect to H2O if not already started\n",
       "    h2o.init()\n",
       "\n",
       "    # Convert the pandas DataFrame to an H2OFrame\n",
       "    data_h2o = h2o.H2OFrame(data_raw)\n",
       "\n",
       "    # Identify the target variable and predictors\n",
       "    target = \"Churn\"\n",
       "    x = [col for col in data_h2o.columns if col != target]\n",
       "\n",
       "    # Convert target variable to factor (categorical)\n",
       "    data_h2o[target] = data_h2o[target].asfactor()\n",
       "\n",
       "    # Set AutoML parameters based on user instructions\n",
       "    aml = H2OAutoML(\n",
       "        max_runtime_secs=30,\n",
       "        exclude_algos=[\"DeepLearning\"],\n",
       "        stopping_metric=\"AUC\",\n",
       "        stopping_rounds=3,\n",
       "        stopping_tolerance=0.001,\n",
       "        balance_classes=True,\n",
       "        seed=42\n",
       "    )\n",
       "\n",
       "    # Train AutoML model\n",
       "    aml.train(x=x, y=target, training_frame=data_h2o)\n",
       "\n",
       "    # Determine model saving logic\n",
       "    if model_directory is None and log_path is None:\n",
       "        model_path = None\n",
       "    else:\n",
       "        the_directory = model_directory if model_directory is not None else log_path\n",
       "        model_path = h2o.save_model(model=aml.leader, path=the_directory, force=True)\n",
       "\n",
       "    return {\n",
       "        \"leaderboard\": aml.leaderboard.as_data_frame().to_dict(),\n",
       "        \"best_model_id\": aml.leader.model_id,\n",
       "        \"model_path\": model_path,\n",
       "    }\n",
       "```"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get the H2O training function in markdown format\n",
    "ml_agent.get_h2o_train_function(markdown=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Recommended ML Steps\n",
    "\n",
    "The AI Machine Learning Agent will provide you with a recommended set of ML steps, which were used to help the Coding Agent create the H2O AutoML models."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "# Recommended ML Steps:\n",
       "Here is a recommended list of steps and considerations for performing H2O AutoML on the provided dataset, focusing on maximizing model accuracy while adhering to the user instructions:\n",
       "\n",
       "1. **Initialize H2O Cluster**:\n",
       "   - Start the H2O cluster locally.\n",
       "   ```python\n",
       "   import h2o\n",
       "   h2o.init()\n",
       "   ```\n",
       "\n",
       "2. **Import Dataset**:\n",
       "   - Load the dataset into the H2O environment.\n",
       "   ```python\n",
       "   data = h2o.import_file(\"path_to_your_dataset.csv\")\n",
       "   ```\n",
       "\n",
       "3. **Identify Predictors and Response**:\n",
       "   - Define the response column (`y`) and the predictor columns (`x`).\n",
       "   ```python\n",
       "   y = \"Churn\"  # response column\n",
       "   x = data.columns\n",
       "   x.remove(y)  # predictors\n",
       "   ```\n",
       "\n",
       "4. **Convert Response Column to Factor**:\n",
       "   - Convert the response variable to a categorical type, as it is a classification problem.\n",
       "   ```python\n",
       "   data[y] = data[y].asfactor()\n",
       "   ```\n",
       "\n",
       "5. **Set AutoML Parameters**:\n",
       "   - Specify `max_runtime_secs` to 30 seconds as per user instructions.\n",
       "   - Exclude Deep Learning algorithms to focus on potentially higher-performing models.\n",
       "   ```python\n",
       "   aml = H2OAutoML(max_runtime_secs=30, exclude_algos=[\"DeepLearning\"], seed=42)\n",
       "   ```\n",
       "\n",
       "6. **Set Stopping Criteria**:\n",
       "   - Use `stopping_metric` to specify AUC as the metric for early stopping, which is relevant for binary classification.\n",
       "   - Set `stopping_rounds` to 3 to allow some patience for model improvement.\n",
       "   - Set `stopping_tolerance` to 0.001 for relative improvement.\n",
       "   ```python\n",
       "   aml = H2OAutoML(max_runtime_secs=30, exclude_algos=[\"DeepLearning\"], \n",
       "                   stopping_metric=\"AUC\", stopping_rounds=3, stopping_tolerance=0.001, seed=42)\n",
       "   ```\n",
       "\n",
       "7. **Balance Classes** (if applicable):\n",
       "   - Consider setting `balance_classes=True` to help handle any class imbalance if present in the dataset.\n",
       "   ```python\n",
       "   aml = H2OAutoML(max_runtime_secs=30, exclude_algos=[\"DeepLearning\"], \n",
       "                   stopping_metric=\"AUC\", stopping_rounds=3, stopping_tolerance=0.001, \n",
       "                   balance_classes=True, seed=42)\n",
       "   ```\n",
       "\n",
       "8. **Train AutoML**:\n",
       "   - Train the AutoML model with the defined parameters.\n",
       "   ```python\n",
       "   aml.train(x=x, y=y, training_frame=data)\n",
       "   ```\n",
       "\n",
       "9. **Review Leaderboard**:\n",
       "   - After training, extract and review the leaderboard to evaluate model performances.\n",
       "   ```python\n",
       "   lb = aml.leaderboard\n",
       "   ```\n",
       "\n",
       "10. **Select Best Model**:\n",
       "   - Identify and retrieve the best model based on the default metric (AUC for binary classification).\n",
       "   ```python\n",
       "   best_model = aml.leader\n",
       "   ```\n",
       "\n",
       "By following these steps, you can effectively set up and execute H2O AutoML on the provided dataset while maximizing predictive accuracy and adhering to user specifications."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get the recommended machine learning steps in markdown format\n",
    "ml_agent.get_recommended_ml_steps(markdown=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Get A Complete Workflow Summary\n",
    "\n",
    "The AI Machine Learning Agent will provide you with a complete workflow summary that includes the Best ML model created, the recommended ML steps, and the Python code used to create the models."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "# H2O Machine Learning Agent Outputs\n",
       "\n",
       "## ---RECOMMENDED STEPS----\n",
       "# Recommended ML Steps:\n",
       "Here is a recommended list of steps and considerations for performing H2O AutoML on the provided dataset, focusing on maximizing model accuracy while adhering to the user instructions:\n",
       "\n",
       "1. **Initialize H2O Cluster**:\n",
       "   - Start the H2O cluster locally.\n",
       "   ```python\n",
       "   import h2o\n",
       "   h2o.init()\n",
       "   ```\n",
       "\n",
       "2. **Import Dataset**:\n",
       "   - Load the dataset into the H2O environment.\n",
       "   ```python\n",
       "   data = h2o.import_file(\"path_to_your_dataset.csv\")\n",
       "   ```\n",
       "\n",
       "3. **Identify Predictors and Response**:\n",
       "   - Define the response column (`y`) and the predictor columns (`x`).\n",
       "   ```python\n",
       "   y = \"Churn\"  # response column\n",
       "   x = data.columns\n",
       "   x.remove(y)  # predictors\n",
       "   ```\n",
       "\n",
       "4. **Convert Response Column to Factor**:\n",
       "   - Convert the response variable to a categorical type, as it is a classification problem.\n",
       "   ```python\n",
       "   data[y] = data[y].asfactor()\n",
       "   ```\n",
       "\n",
       "5. **Set AutoML Parameters**:\n",
       "   - Specify `max_runtime_secs` to 30 seconds as per user instructions.\n",
       "   - Exclude Deep Learning algorithms to focus on potentially higher-performing models.\n",
       "   ```python\n",
       "   aml = H2OAutoML(max_runtime_secs=30, exclude_algos=[\"DeepLearning\"], seed=42)\n",
       "   ```\n",
       "\n",
       "6. **Set Stopping Criteria**:\n",
       "   - Use `stopping_metric` to specify AUC as the metric for early stopping, which is relevant for binary classification.\n",
       "   - Set `stopping_rounds` to 3 to allow some patience for model improvement.\n",
       "   - Set `stopping_tolerance` to 0.001 for relative improvement.\n",
       "   ```python\n",
       "   aml = H2OAutoML(max_runtime_secs=30, exclude_algos=[\"DeepLearning\"], \n",
       "                   stopping_metric=\"AUC\", stopping_rounds=3, stopping_tolerance=0.001, seed=42)\n",
       "   ```\n",
       "\n",
       "7. **Balance Classes** (if applicable):\n",
       "   - Consider setting `balance_classes=True` to help handle any class imbalance if present in the dataset.\n",
       "   ```python\n",
       "   aml = H2OAutoML(max_runtime_secs=30, exclude_algos=[\"DeepLearning\"], \n",
       "                   stopping_metric=\"AUC\", stopping_rounds=3, stopping_tolerance=0.001, \n",
       "                   balance_classes=True, seed=42)\n",
       "   ```\n",
       "\n",
       "8. **Train AutoML**:\n",
       "   - Train the AutoML model with the defined parameters.\n",
       "   ```python\n",
       "   aml.train(x=x, y=y, training_frame=data)\n",
       "   ```\n",
       "\n",
       "9. **Review Leaderboard**:\n",
       "   - After training, extract and review the leaderboard to evaluate model performances.\n",
       "   ```python\n",
       "   lb = aml.leaderboard\n",
       "   ```\n",
       "\n",
       "10. **Select Best Model**:\n",
       "   - Identify and retrieve the best model based on the default metric (AUC for binary classification).\n",
       "   ```python\n",
       "   best_model = aml.leader\n",
       "   ```\n",
       "\n",
       "By following these steps, you can effectively set up and execute H2O AutoML on the provided dataset while maximizing predictive accuracy and adhering to user specifications.\n",
       "\n",
       "## ---H2O TRAIN FUNCTION----\n",
       "```python\n",
       "# Disclaimer: This function was generated by AI. Please review before using.\n",
       "# Agent Name: h2o_ml_agent\n",
       "# Time Created: 2025-01-17 18:27:20\n",
       "\n",
       "def h2o_automl(data_raw, model_directory=None, log_path=None):\n",
       "    import h2o\n",
       "    from h2o.automl import H2OAutoML\n",
       "    import pandas as pd\n",
       "\n",
       "\n",
       "\n",
       "    # Initialize or connect to H2O if not already started\n",
       "    h2o.init()\n",
       "\n",
       "    # Convert the pandas DataFrame to an H2OFrame\n",
       "    data_h2o = h2o.H2OFrame(data_raw)\n",
       "\n",
       "    # Identify the target variable and predictors\n",
       "    target = \"Churn\"\n",
       "    x = [col for col in data_h2o.columns if col != target]\n",
       "\n",
       "    # Convert target variable to factor (categorical)\n",
       "    data_h2o[target] = data_h2o[target].asfactor()\n",
       "\n",
       "    # Set AutoML parameters based on user instructions\n",
       "    aml = H2OAutoML(\n",
       "        max_runtime_secs=30,\n",
       "        exclude_algos=[\"DeepLearning\"],\n",
       "        stopping_metric=\"AUC\",\n",
       "        stopping_rounds=3,\n",
       "        stopping_tolerance=0.001,\n",
       "        balance_classes=True,\n",
       "        seed=42\n",
       "    )\n",
       "\n",
       "    # Train AutoML model\n",
       "    aml.train(x=x, y=target, training_frame=data_h2o)\n",
       "\n",
       "    # Determine model saving logic\n",
       "    if model_directory is None and log_path is None:\n",
       "        model_path = None\n",
       "    else:\n",
       "        the_directory = model_directory if model_directory is not None else log_path\n",
       "        model_path = h2o.save_model(model=aml.leader, path=the_directory, force=True)\n",
       "\n",
       "    return {\n",
       "        \"leaderboard\": aml.leaderboard.as_data_frame().to_dict(),\n",
       "        \"best_model_id\": aml.leader.model_id,\n",
       "        \"model_path\": model_path,\n",
       "    }\n",
       "```\n",
       "\n",
       "## ---H2O TRAIN FUNCTION PATH----\n",
       "```python\n",
       "logs/h2o_automl.py\n",
       "```\n",
       "\n",
       "## ---H2O TRAIN FUNCTION NAME----\n",
       "```python\n",
       "h2o_automl\n",
       "```\n",
       "\n",
       "## ---H2O TRAIN ERROR----\n",
       "None\n",
       "\n",
       "## ---MODEL PATH----\n",
       "None\n",
       "\n",
       "## ---BEST MODEL ID----\n",
       "StackedEnsemble_BestOfFamily_2_AutoML_2_20250117_182721"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get a summary of the workflow in markdown format\n",
    "ml_agent.get_workflow_summary(markdown=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Get The Logging Summary \n",
    "\n",
    "The AI Machine Learning Agent will provide you with a logging summary that includes the ML models created and Python code location."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "\n",
       "## H2O Machine Learning Agent Log Summary:\n",
       "\n",
       "Function Path: logs/h2o_automl.py\n",
       "\n",
       "Function Name: h2o_automl\n",
       "\n",
       "Best Model ID: StackedEnsemble_BestOfFamily_2_AutoML_2_20250117_182721\n",
       "\n",
       "Model Path: None\n",
       "                "
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get a summary of the logs in markdown format\n",
    "ml_agent.get_log_summary(markdown=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Get the Best Model ID"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'StackedEnsemble_BestOfFamily_2_AutoML_2_20250117_182721'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ml_agent.get_best_model_id()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load The Model\n",
    "\n",
    "Run the code to load the model and view the model summary, get performance metrics, make predictions, and explain the model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Checking whether there is an H2O instance running at http://localhost:54321. connected.\n",
      "Warning: Your H2O cluster version is (10 months and 4 days) old.  There may be a newer version available.\n",
      "Please download and install the latest version from: https://h2o-release.s3.amazonaws.com/h2o/latest_stable.html\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<style>\n",
       "\n",
       "#h2o-table-12.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-12 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-12 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-12 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-12 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-12 .h2o-table th,\n",
       "#h2o-table-12 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-12 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-12\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption></caption>\n",
       "    <thead></thead>\n",
       "    <tbody><tr><td>H2O_cluster_uptime:</td>\n",
       "<td>7 hours 22 mins</td></tr>\n",
       "<tr><td>H2O_cluster_timezone:</td>\n",
       "<td>America/New_York</td></tr>\n",
       "<tr><td>H2O_data_parsing_timezone:</td>\n",
       "<td>UTC</td></tr>\n",
       "<tr><td>H2O_cluster_version:</td>\n",
       "<td>3.46.0.1</td></tr>\n",
       "<tr><td>H2O_cluster_version_age:</td>\n",
       "<td>10 months and 4 days</td></tr>\n",
       "<tr><td>H2O_cluster_name:</td>\n",
       "<td>H2O_from_python_mdancho_ag7ena</td></tr>\n",
       "<tr><td>H2O_cluster_total_nodes:</td>\n",
       "<td>1</td></tr>\n",
       "<tr><td>H2O_cluster_free_memory:</td>\n",
       "<td>11.94 Gb</td></tr>\n",
       "<tr><td>H2O_cluster_total_cores:</td>\n",
       "<td>14</td></tr>\n",
       "<tr><td>H2O_cluster_allowed_cores:</td>\n",
       "<td>14</td></tr>\n",
       "<tr><td>H2O_cluster_status:</td>\n",
       "<td>locked, healthy</td></tr>\n",
       "<tr><td>H2O_connection_url:</td>\n",
       "<td>http://localhost:54321</td></tr>\n",
       "<tr><td>H2O_connection_proxy:</td>\n",
       "<td>{\"http\": null, \"https\": null}</td></tr>\n",
       "<tr><td>H2O_internal_security:</td>\n",
       "<td>False</td></tr>\n",
       "<tr><td>Python_version:</td>\n",
       "<td>3.10.13 final</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n"
      ],
      "text/plain": [
       "--------------------------  ------------------------------\n",
       "H2O_cluster_uptime:         7 hours 22 mins\n",
       "H2O_cluster_timezone:       America/New_York\n",
       "H2O_data_parsing_timezone:  UTC\n",
       "H2O_cluster_version:        3.46.0.1\n",
       "H2O_cluster_version_age:    10 months and 4 days\n",
       "H2O_cluster_name:           H2O_from_python_mdancho_ag7ena\n",
       "H2O_cluster_total_nodes:    1\n",
       "H2O_cluster_free_memory:    11.94 Gb\n",
       "H2O_cluster_total_cores:    14\n",
       "H2O_cluster_allowed_cores:  14\n",
       "H2O_cluster_status:         locked, healthy\n",
       "H2O_connection_url:         http://localhost:54321\n",
       "H2O_connection_proxy:       {\"http\": null, \"https\": null}\n",
       "H2O_internal_security:      False\n",
       "Python_version:             3.10.13 final\n",
       "--------------------------  ------------------------------"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "h2o.init()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Load The Model and Display Performance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style='margin: 1em 0 1em 0;'>Model Details\n",
       "=============\n",
       "H2OStackedEnsembleEstimator : Stacked Ensemble\n",
       "Model Key: StackedEnsemble_BestOfFamily_2_AutoML_2_20250117_182721\n",
       "</pre>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-13.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-13 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-13 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-13 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-13 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-13 .h2o-table th,\n",
       "#h2o-table-13 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-13 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-13\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Model Summary for Stacked Ensemble: </caption>\n",
       "    <thead><tr><th>key</th>\n",
       "<th>value</th></tr></thead>\n",
       "    <tbody><tr><td>Stacking strategy</td>\n",
       "<td>cross_validation</td></tr>\n",
       "<tr><td>Number of base models (used / total)</td>\n",
       "<td>2/4</td></tr>\n",
       "<tr><td># GBM base models (used / total)</td>\n",
       "<td>1/1</td></tr>\n",
       "<tr><td># XGBoost base models (used / total)</td>\n",
       "<td>0/1</td></tr>\n",
       "<tr><td># GLM base models (used / total)</td>\n",
       "<td>1/1</td></tr>\n",
       "<tr><td># DRF base models (used / total)</td>\n",
       "<td>0/1</td></tr>\n",
       "<tr><td>Metalearner algorithm</td>\n",
       "<td>GLM</td></tr>\n",
       "<tr><td>Metalearner fold assignment scheme</td>\n",
       "<td>Random</td></tr>\n",
       "<tr><td>Metalearner nfolds</td>\n",
       "<td>5</td></tr>\n",
       "<tr><td>Metalearner fold_column</td>\n",
       "<td>None</td></tr>\n",
       "<tr><td>Custom metalearner hyperparameters</td>\n",
       "<td>None</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div>\n",
       "<div style='margin: 1em 0 1em 0;'><pre style='margin: 1em 0 1em 0;'>ModelMetricsBinomialGLM: stackedensemble\n",
       "** Reported on train data. **\n",
       "\n",
       "MSE: 0.12280258481192449\n",
       "RMSE: 0.3504319974145119\n",
       "LogLoss: 0.38118316635829386\n",
       "AUC: 0.8755385872855243\n",
       "AUCPR: 0.7225887060960569\n",
       "Gini: 0.7510771745710485\n",
       "Null degrees of freedom: 7042\n",
       "Residual degrees of freedom: 7040\n",
       "Null deviance: 8150.145899019416\n",
       "Residual deviance: 5369.346081322927\n",
       "AIC: 5375.346081322927</pre>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-14.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-14 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-14 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-14 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-14 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-14 .h2o-table th,\n",
       "#h2o-table-14 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-14 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-14\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Confusion Matrix (Act/Pred) for max f1 @ threshold = 0.28863204785206925</caption>\n",
       "    <thead><tr><th></th>\n",
       "<th>No</th>\n",
       "<th>Yes</th>\n",
       "<th>Error</th>\n",
       "<th>Rate</th></tr></thead>\n",
       "    <tbody><tr><td>No</td>\n",
       "<td>4002.0</td>\n",
       "<td>1172.0</td>\n",
       "<td>0.2265</td>\n",
       "<td> (1172.0/5174.0)</td></tr>\n",
       "<tr><td>Yes</td>\n",
       "<td>341.0</td>\n",
       "<td>1528.0</td>\n",
       "<td>0.1825</td>\n",
       "<td> (341.0/1869.0)</td></tr>\n",
       "<tr><td>Total</td>\n",
       "<td>4343.0</td>\n",
       "<td>2700.0</td>\n",
       "<td>0.2148</td>\n",
       "<td> (1513.0/7043.0)</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-15.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-15 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-15 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-15 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-15 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-15 .h2o-table th,\n",
       "#h2o-table-15 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-15 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-15\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Maximum Metrics: Maximum metrics at their respective thresholds</caption>\n",
       "    <thead><tr><th>metric</th>\n",
       "<th>threshold</th>\n",
       "<th>value</th>\n",
       "<th>idx</th></tr></thead>\n",
       "    <tbody><tr><td>max f1</td>\n",
       "<td>0.2886320</td>\n",
       "<td>0.6688553</td>\n",
       "<td>229.0</td></tr>\n",
       "<tr><td>max f2</td>\n",
       "<td>0.1639926</td>\n",
       "<td>0.7709251</td>\n",
       "<td>289.0</td></tr>\n",
       "<tr><td>max f0point5</td>\n",
       "<td>0.5533829</td>\n",
       "<td>0.6779901</td>\n",
       "<td>117.0</td></tr>\n",
       "<tr><td>max accuracy</td>\n",
       "<td>0.5092172</td>\n",
       "<td>0.8233707</td>\n",
       "<td>137.0</td></tr>\n",
       "<tr><td>max precision</td>\n",
       "<td>0.8685693</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max recall</td>\n",
       "<td>0.0125838</td>\n",
       "<td>1.0</td>\n",
       "<td>391.0</td></tr>\n",
       "<tr><td>max specificity</td>\n",
       "<td>0.8685693</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max absolute_mcc</td>\n",
       "<td>0.2886320</td>\n",
       "<td>0.5367256</td>\n",
       "<td>229.0</td></tr>\n",
       "<tr><td>max min_per_class_accuracy</td>\n",
       "<td>0.3096726</td>\n",
       "<td>0.7881220</td>\n",
       "<td>220.0</td></tr>\n",
       "<tr><td>max mean_per_class_accuracy</td>\n",
       "<td>0.2886320</td>\n",
       "<td>0.7955161</td>\n",
       "<td>229.0</td></tr>\n",
       "<tr><td>max tns</td>\n",
       "<td>0.8685693</td>\n",
       "<td>5174.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fns</td>\n",
       "<td>0.8685693</td>\n",
       "<td>1867.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fps</td>\n",
       "<td>0.0050385</td>\n",
       "<td>5174.0</td>\n",
       "<td>399.0</td></tr>\n",
       "<tr><td>max tps</td>\n",
       "<td>0.0125838</td>\n",
       "<td>1869.0</td>\n",
       "<td>391.0</td></tr>\n",
       "<tr><td>max tnr</td>\n",
       "<td>0.8685693</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fnr</td>\n",
       "<td>0.8685693</td>\n",
       "<td>0.9989299</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fpr</td>\n",
       "<td>0.0050385</td>\n",
       "<td>1.0</td>\n",
       "<td>399.0</td></tr>\n",
       "<tr><td>max tpr</td>\n",
       "<td>0.0125838</td>\n",
       "<td>1.0</td>\n",
       "<td>391.0</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-16.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-16 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-16 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-16 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-16 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-16 .h2o-table th,\n",
       "#h2o-table-16 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-16 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-16\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Gains/Lift Table: Avg response rate: 26.54 %, avg score: 26.55 %</caption>\n",
       "    <thead><tr><th>group</th>\n",
       "<th>cumulative_data_fraction</th>\n",
       "<th>lower_threshold</th>\n",
       "<th>lift</th>\n",
       "<th>cumulative_lift</th>\n",
       "<th>response_rate</th>\n",
       "<th>score</th>\n",
       "<th>cumulative_response_rate</th>\n",
       "<th>cumulative_score</th>\n",
       "<th>capture_rate</th>\n",
       "<th>cumulative_capture_rate</th>\n",
       "<th>gain</th>\n",
       "<th>cumulative_gain</th>\n",
       "<th>kolmogorov_smirnov</th></tr></thead>\n",
       "    <tbody><tr><td>1</td>\n",
       "<td>0.0100809</td>\n",
       "<td>0.8249117</td>\n",
       "<td>3.6621753</td>\n",
       "<td>3.6621753</td>\n",
       "<td>0.9718310</td>\n",
       "<td>0.8408366</td>\n",
       "<td>0.9718310</td>\n",
       "<td>0.8408366</td>\n",
       "<td>0.0369181</td>\n",
       "<td>0.0369181</td>\n",
       "<td>266.2175299</td>\n",
       "<td>266.2175299</td>\n",
       "<td>0.0365316</td></tr>\n",
       "<tr><td>2</td>\n",
       "<td>0.0200199</td>\n",
       "<td>0.8016166</td>\n",
       "<td>3.3376596</td>\n",
       "<td>3.5010682</td>\n",
       "<td>0.8857143</td>\n",
       "<td>0.8130285</td>\n",
       "<td>0.9290780</td>\n",
       "<td>0.8270312</td>\n",
       "<td>0.0331728</td>\n",
       "<td>0.0700910</td>\n",
       "<td>233.7659558</td>\n",
       "<td>250.1068194</td>\n",
       "<td>0.0681582</td></tr>\n",
       "<tr><td>3</td>\n",
       "<td>0.0301008</td>\n",
       "<td>0.7848294</td>\n",
       "<td>3.3968003</td>\n",
       "<td>3.4661483</td>\n",
       "<td>0.9014085</td>\n",
       "<td>0.7920673</td>\n",
       "<td>0.9198113</td>\n",
       "<td>0.8153216</td>\n",
       "<td>0.0342429</td>\n",
       "<td>0.1043339</td>\n",
       "<td>239.6800277</td>\n",
       "<td>246.6148278</td>\n",
       "<td>0.1010482</td></tr>\n",
       "<tr><td>4</td>\n",
       "<td>0.0400398</td>\n",
       "<td>0.7693139</td>\n",
       "<td>3.4453260</td>\n",
       "<td>3.4609796</td>\n",
       "<td>0.9142857</td>\n",
       "<td>0.7772038</td>\n",
       "<td>0.9184397</td>\n",
       "<td>0.8058597</td>\n",
       "<td>0.0342429</td>\n",
       "<td>0.1385768</td>\n",
       "<td>244.5325996</td>\n",
       "<td>246.0979627</td>\n",
       "<td>0.1341315</td></tr>\n",
       "<tr><td>5</td>\n",
       "<td>0.0501207</td>\n",
       "<td>0.7543438</td>\n",
       "<td>3.1845003</td>\n",
       "<td>3.4053705</td>\n",
       "<td>0.8450704</td>\n",
       "<td>0.7618947</td>\n",
       "<td>0.9036827</td>\n",
       "<td>0.7970169</td>\n",
       "<td>0.0321027</td>\n",
       "<td>0.1706795</td>\n",
       "<td>218.4500260</td>\n",
       "<td>240.5370462</td>\n",
       "<td>0.1641082</td></tr>\n",
       "<tr><td>6</td>\n",
       "<td>0.1000994</td>\n",
       "<td>0.6652166</td>\n",
       "<td>2.8262440</td>\n",
       "<td>3.1162179</td>\n",
       "<td>0.75</td>\n",
       "<td>0.7081436</td>\n",
       "<td>0.8269504</td>\n",
       "<td>0.7526433</td>\n",
       "<td>0.1412520</td>\n",
       "<td>0.3119315</td>\n",
       "<td>182.6243981</td>\n",
       "<td>211.6217949</td>\n",
       "<td>0.2883521</td></tr>\n",
       "<tr><td>7</td>\n",
       "<td>0.1500781</td>\n",
       "<td>0.5947576</td>\n",
       "<td>2.5050799</td>\n",
       "<td>2.9126980</td>\n",
       "<td>0.6647727</td>\n",
       "<td>0.6294255</td>\n",
       "<td>0.7729423</td>\n",
       "<td>0.7116095</td>\n",
       "<td>0.1252006</td>\n",
       "<td>0.4371322</td>\n",
       "<td>150.5079892</td>\n",
       "<td>191.2697991</td>\n",
       "<td>0.3907464</td></tr>\n",
       "<tr><td>8</td>\n",
       "<td>0.2000568</td>\n",
       "<td>0.5306794</td>\n",
       "<td>2.0982720</td>\n",
       "<td>2.7092360</td>\n",
       "<td>0.5568182</td>\n",
       "<td>0.5631694</td>\n",
       "<td>0.7189496</td>\n",
       "<td>0.6745258</td>\n",
       "<td>0.1048689</td>\n",
       "<td>0.5420011</td>\n",
       "<td>109.8272046</td>\n",
       "<td>170.9236009</td>\n",
       "<td>0.4654645</td></tr>\n",
       "<tr><td>9</td>\n",
       "<td>0.3000142</td>\n",
       "<td>0.3818328</td>\n",
       "<td>1.6539951</td>\n",
       "<td>2.3576555</td>\n",
       "<td>0.4389205</td>\n",
       "<td>0.4565728</td>\n",
       "<td>0.6256507</td>\n",
       "<td>0.6019092</td>\n",
       "<td>0.1653291</td>\n",
       "<td>0.7073301</td>\n",
       "<td>65.3995057</td>\n",
       "<td>135.7655493</td>\n",
       "<td>0.5544503</td></tr>\n",
       "<tr><td>10</td>\n",
       "<td>0.3999716</td>\n",
       "<td>0.2728038</td>\n",
       "<td>1.2364817</td>\n",
       "<td>2.0774616</td>\n",
       "<td>0.328125</td>\n",
       "<td>0.3257965</td>\n",
       "<td>0.5512957</td>\n",
       "<td>0.5329056</td>\n",
       "<td>0.1235955</td>\n",
       "<td>0.8309256</td>\n",
       "<td>23.6481742</td>\n",
       "<td>107.7461556</td>\n",
       "<td>0.5866272</td></tr>\n",
       "<tr><td>11</td>\n",
       "<td>0.5000710</td>\n",
       "<td>0.1778435</td>\n",
       "<td>0.7536651</td>\n",
       "<td>1.8124767</td>\n",
       "<td>0.2</td>\n",
       "<td>0.2246125</td>\n",
       "<td>0.4809767</td>\n",
       "<td>0.4711944</td>\n",
       "<td>0.0754414</td>\n",
       "<td>0.9063670</td>\n",
       "<td>-24.6334938</td>\n",
       "<td>81.2476738</td>\n",
       "<td>0.5530621</td></tr>\n",
       "<tr><td>12</td>\n",
       "<td>0.6000284</td>\n",
       "<td>0.1109879</td>\n",
       "<td>0.4870989</td>\n",
       "<td>1.5916850</td>\n",
       "<td>0.1292614</td>\n",
       "<td>0.1420329</td>\n",
       "<td>0.4223852</td>\n",
       "<td>0.4163601</td>\n",
       "<td>0.0486891</td>\n",
       "<td>0.9550562</td>\n",
       "<td>-51.2901132</td>\n",
       "<td>59.1684968</td>\n",
       "<td>0.4832742</td></tr>\n",
       "<tr><td>13</td>\n",
       "<td>0.6999858</td>\n",
       "<td>0.0574955</td>\n",
       "<td>0.2783422</td>\n",
       "<td>1.4041407</td>\n",
       "<td>0.0738636</td>\n",
       "<td>0.0820331</td>\n",
       "<td>0.3726166</td>\n",
       "<td>0.3686185</td>\n",
       "<td>0.0278224</td>\n",
       "<td>0.9828785</td>\n",
       "<td>-72.1657790</td>\n",
       "<td>40.4140688</td>\n",
       "<td>0.3850819</td></tr>\n",
       "<tr><td>14</td>\n",
       "<td>0.7999432</td>\n",
       "<td>0.0293164</td>\n",
       "<td>0.1017020</td>\n",
       "<td>1.2413936</td>\n",
       "<td>0.0269886</td>\n",
       "<td>0.0422363</td>\n",
       "<td>0.3294285</td>\n",
       "<td>0.3278352</td>\n",
       "<td>0.0101659</td>\n",
       "<td>0.9930444</td>\n",
       "<td>-89.8298039</td>\n",
       "<td>24.1393641</td>\n",
       "<td>0.2628550</td></tr>\n",
       "<tr><td>15</td>\n",
       "<td>0.8999006</td>\n",
       "<td>0.0157667</td>\n",
       "<td>0.0535273</td>\n",
       "<td>1.1094501</td>\n",
       "<td>0.0142045</td>\n",
       "<td>0.0216630</td>\n",
       "<td>0.2944146</td>\n",
       "<td>0.2938268</td>\n",
       "<td>0.0053505</td>\n",
       "<td>0.9983949</td>\n",
       "<td>-94.6472652</td>\n",
       "<td>10.9450146</td>\n",
       "<td>0.1340733</td></tr>\n",
       "<tr><td>16</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0044344</td>\n",
       "<td>0.0160354</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0042553</td>\n",
       "<td>0.0106067</td>\n",
       "<td>0.2653699</td>\n",
       "<td>0.2654766</td>\n",
       "<td>0.0016051</td>\n",
       "<td>1.0</td>\n",
       "<td>-98.3964573</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div></div>\n",
       "<div style='margin: 1em 0 1em 0;'><pre style='margin: 1em 0 1em 0;'>ModelMetricsBinomialGLM: stackedensemble\n",
       "** Reported on cross-validation data. **\n",
       "\n",
       "MSE: 0.13343936715812627\n",
       "RMSE: 0.36529353560955097\n",
       "LogLoss: 0.41095045439479133\n",
       "AUC: 0.8500058323473151\n",
       "AUCPR: 0.6660452986059002\n",
       "Gini: 0.7000116646946302\n",
       "Null degrees of freedom: 7042\n",
       "Residual degrees of freedom: 7039\n",
       "Null deviance: 8151.868367609408\n",
       "Residual deviance: 5788.648100605031\n",
       "AIC: 5796.648100605031</pre>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-17.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-17 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-17 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-17 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-17 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-17 .h2o-table th,\n",
       "#h2o-table-17 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-17 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-17\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Confusion Matrix (Act/Pred) for max f1 @ threshold = 0.288417727959037</caption>\n",
       "    <thead><tr><th></th>\n",
       "<th>No</th>\n",
       "<th>Yes</th>\n",
       "<th>Error</th>\n",
       "<th>Rate</th></tr></thead>\n",
       "    <tbody><tr><td>No</td>\n",
       "<td>3937.0</td>\n",
       "<td>1237.0</td>\n",
       "<td>0.2391</td>\n",
       "<td> (1237.0/5174.0)</td></tr>\n",
       "<tr><td>Yes</td>\n",
       "<td>407.0</td>\n",
       "<td>1462.0</td>\n",
       "<td>0.2178</td>\n",
       "<td> (407.0/1869.0)</td></tr>\n",
       "<tr><td>Total</td>\n",
       "<td>4344.0</td>\n",
       "<td>2699.0</td>\n",
       "<td>0.2334</td>\n",
       "<td> (1644.0/7043.0)</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-18.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-18 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-18 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-18 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-18 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-18 .h2o-table th,\n",
       "#h2o-table-18 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-18 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-18\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Maximum Metrics: Maximum metrics at their respective thresholds</caption>\n",
       "    <thead><tr><th>metric</th>\n",
       "<th>threshold</th>\n",
       "<th>value</th>\n",
       "<th>idx</th></tr></thead>\n",
       "    <tbody><tr><td>max f1</td>\n",
       "<td>0.2884177</td>\n",
       "<td>0.6401051</td>\n",
       "<td>234.0</td></tr>\n",
       "<tr><td>max f2</td>\n",
       "<td>0.1585833</td>\n",
       "<td>0.7515611</td>\n",
       "<td>296.0</td></tr>\n",
       "<tr><td>max f0point5</td>\n",
       "<td>0.5163654</td>\n",
       "<td>0.6403497</td>\n",
       "<td>135.0</td></tr>\n",
       "<tr><td>max accuracy</td>\n",
       "<td>0.5163654</td>\n",
       "<td>0.8077524</td>\n",
       "<td>135.0</td></tr>\n",
       "<tr><td>max precision</td>\n",
       "<td>0.8862381</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max recall</td>\n",
       "<td>0.0071124</td>\n",
       "<td>1.0</td>\n",
       "<td>397.0</td></tr>\n",
       "<tr><td>max specificity</td>\n",
       "<td>0.8862381</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max absolute_mcc</td>\n",
       "<td>0.2650552</td>\n",
       "<td>0.4937726</td>\n",
       "<td>245.0</td></tr>\n",
       "<tr><td>max min_per_class_accuracy</td>\n",
       "<td>0.2963764</td>\n",
       "<td>0.7683253</td>\n",
       "<td>230.0</td></tr>\n",
       "<tr><td>max mean_per_class_accuracy</td>\n",
       "<td>0.2650552</td>\n",
       "<td>0.7753190</td>\n",
       "<td>245.0</td></tr>\n",
       "<tr><td>max tns</td>\n",
       "<td>0.8862381</td>\n",
       "<td>5174.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fns</td>\n",
       "<td>0.8862381</td>\n",
       "<td>1867.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fps</td>\n",
       "<td>0.0049395</td>\n",
       "<td>5174.0</td>\n",
       "<td>399.0</td></tr>\n",
       "<tr><td>max tps</td>\n",
       "<td>0.0071124</td>\n",
       "<td>1869.0</td>\n",
       "<td>397.0</td></tr>\n",
       "<tr><td>max tnr</td>\n",
       "<td>0.8862381</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fnr</td>\n",
       "<td>0.8862381</td>\n",
       "<td>0.9989299</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>max fpr</td>\n",
       "<td>0.0049395</td>\n",
       "<td>1.0</td>\n",
       "<td>399.0</td></tr>\n",
       "<tr><td>max tpr</td>\n",
       "<td>0.0071124</td>\n",
       "<td>1.0</td>\n",
       "<td>397.0</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-19.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-19 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-19 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-19 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-19 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-19 .h2o-table th,\n",
       "#h2o-table-19 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-19 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-19\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Gains/Lift Table: Avg response rate: 26.54 %, avg score: 26.54 %</caption>\n",
       "    <thead><tr><th>group</th>\n",
       "<th>cumulative_data_fraction</th>\n",
       "<th>lower_threshold</th>\n",
       "<th>lift</th>\n",
       "<th>cumulative_lift</th>\n",
       "<th>response_rate</th>\n",
       "<th>score</th>\n",
       "<th>cumulative_response_rate</th>\n",
       "<th>cumulative_score</th>\n",
       "<th>capture_rate</th>\n",
       "<th>cumulative_capture_rate</th>\n",
       "<th>gain</th>\n",
       "<th>cumulative_gain</th>\n",
       "<th>kolmogorov_smirnov</th></tr></thead>\n",
       "    <tbody><tr><td>1</td>\n",
       "<td>0.0100809</td>\n",
       "<td>0.8213740</td>\n",
       "<td>3.4498753</td>\n",
       "<td>3.4498753</td>\n",
       "<td>0.9154930</td>\n",
       "<td>0.8382947</td>\n",
       "<td>0.9154930</td>\n",
       "<td>0.8382947</td>\n",
       "<td>0.0347780</td>\n",
       "<td>0.0347780</td>\n",
       "<td>244.9875282</td>\n",
       "<td>244.9875282</td>\n",
       "<td>0.0336183</td></tr>\n",
       "<tr><td>2</td>\n",
       "<td>0.0200199</td>\n",
       "<td>0.7955516</td>\n",
       "<td>3.1223267</td>\n",
       "<td>3.2872625</td>\n",
       "<td>0.8285714</td>\n",
       "<td>0.8065485</td>\n",
       "<td>0.8723404</td>\n",
       "<td>0.8225342</td>\n",
       "<td>0.0310326</td>\n",
       "<td>0.0658106</td>\n",
       "<td>212.2326683</td>\n",
       "<td>228.7262502</td>\n",
       "<td>0.0623317</td></tr>\n",
       "<tr><td>3</td>\n",
       "<td>0.0301008</td>\n",
       "<td>0.7787034</td>\n",
       "<td>3.0783503</td>\n",
       "<td>3.2172966</td>\n",
       "<td>0.8169014</td>\n",
       "<td>0.7870960</td>\n",
       "<td>0.8537736</td>\n",
       "<td>0.8106657</td>\n",
       "<td>0.0310326</td>\n",
       "<td>0.0968432</td>\n",
       "<td>207.8350251</td>\n",
       "<td>221.7296607</td>\n",
       "<td>0.0908517</td></tr>\n",
       "<tr><td>4</td>\n",
       "<td>0.0400398</td>\n",
       "<td>0.7650570</td>\n",
       "<td>3.1223267</td>\n",
       "<td>3.1937225</td>\n",
       "<td>0.8285714</td>\n",
       "<td>0.7725948</td>\n",
       "<td>0.8475177</td>\n",
       "<td>0.8012155</td>\n",
       "<td>0.0310326</td>\n",
       "<td>0.1278759</td>\n",
       "<td>212.2326683</td>\n",
       "<td>219.3722513</td>\n",
       "<td>0.1195651</td></tr>\n",
       "<tr><td>5</td>\n",
       "<td>0.0501207</td>\n",
       "<td>0.7455306</td>\n",
       "<td>3.0783503</td>\n",
       "<td>3.1705173</td>\n",
       "<td>0.8169014</td>\n",
       "<td>0.7544141</td>\n",
       "<td>0.8413598</td>\n",
       "<td>0.7918022</td>\n",
       "<td>0.0310326</td>\n",
       "<td>0.1589085</td>\n",
       "<td>207.8350251</td>\n",
       "<td>217.0517327</td>\n",
       "<td>0.1480852</td></tr>\n",
       "<tr><td>6</td>\n",
       "<td>0.1000994</td>\n",
       "<td>0.6592997</td>\n",
       "<td>2.6228401</td>\n",
       "<td>2.8970671</td>\n",
       "<td>0.6960227</td>\n",
       "<td>0.7008956</td>\n",
       "<td>0.7687943</td>\n",
       "<td>0.7464134</td>\n",
       "<td>0.1310861</td>\n",
       "<td>0.2899946</td>\n",
       "<td>162.2840058</td>\n",
       "<td>189.7067116</td>\n",
       "<td>0.2584910</td></tr>\n",
       "<tr><td>7</td>\n",
       "<td>0.1500781</td>\n",
       "<td>0.5946767</td>\n",
       "<td>2.3337924</td>\n",
       "<td>2.7094865</td>\n",
       "<td>0.6193182</td>\n",
       "<td>0.6260252</td>\n",
       "<td>0.7190161</td>\n",
       "<td>0.7063219</td>\n",
       "<td>0.1166399</td>\n",
       "<td>0.4066346</td>\n",
       "<td>133.3792378</td>\n",
       "<td>170.9486503</td>\n",
       "<td>0.3492322</td></tr>\n",
       "<tr><td>8</td>\n",
       "<td>0.2000568</td>\n",
       "<td>0.5283296</td>\n",
       "<td>2.0554502</td>\n",
       "<td>2.5460935</td>\n",
       "<td>0.5454545</td>\n",
       "<td>0.5608333</td>\n",
       "<td>0.6756565</td>\n",
       "<td>0.6699756</td>\n",
       "<td>0.1027287</td>\n",
       "<td>0.5093633</td>\n",
       "<td>105.5450168</td>\n",
       "<td>154.6093465</td>\n",
       "<td>0.4210370</td></tr>\n",
       "<tr><td>9</td>\n",
       "<td>0.3000142</td>\n",
       "<td>0.3857774</td>\n",
       "<td>1.6165259</td>\n",
       "<td>2.2363843</td>\n",
       "<td>0.4289773</td>\n",
       "<td>0.4583619</td>\n",
       "<td>0.5934690</td>\n",
       "<td>0.5994711</td>\n",
       "<td>0.1615837</td>\n",
       "<td>0.6709470</td>\n",
       "<td>61.6525913</td>\n",
       "<td>123.6384257</td>\n",
       "<td>0.5049246</td></tr>\n",
       "<tr><td>10</td>\n",
       "<td>0.3999716</td>\n",
       "<td>0.2752011</td>\n",
       "<td>1.2632454</td>\n",
       "<td>1.9931859</td>\n",
       "<td>0.3352273</td>\n",
       "<td>0.3234361</td>\n",
       "<td>0.5289315</td>\n",
       "<td>0.5304868</td>\n",
       "<td>0.1262707</td>\n",
       "<td>0.7972178</td>\n",
       "<td>26.3245416</td>\n",
       "<td>99.3185910</td>\n",
       "<td>0.5407431</td></tr>\n",
       "<tr><td>11</td>\n",
       "<td>0.5000710</td>\n",
       "<td>0.1822800</td>\n",
       "<td>0.8391873</td>\n",
       "<td>1.7621896</td>\n",
       "<td>0.2226950</td>\n",
       "<td>0.2273001</td>\n",
       "<td>0.4676320</td>\n",
       "<td>0.4697978</td>\n",
       "<td>0.0840021</td>\n",
       "<td>0.8812199</td>\n",
       "<td>-16.0812662</td>\n",
       "<td>76.2189603</td>\n",
       "<td>0.5188310</td></tr>\n",
       "<tr><td>12</td>\n",
       "<td>0.6000284</td>\n",
       "<td>0.1103539</td>\n",
       "<td>0.5620372</td>\n",
       "<td>1.5622589</td>\n",
       "<td>0.1491477</td>\n",
       "<td>0.1441392</td>\n",
       "<td>0.4145764</td>\n",
       "<td>0.4155471</td>\n",
       "<td>0.0561798</td>\n",
       "<td>0.9373997</td>\n",
       "<td>-43.7962845</td>\n",
       "<td>56.2258859</td>\n",
       "<td>0.4592396</td></tr>\n",
       "<tr><td>13</td>\n",
       "<td>0.6999858</td>\n",
       "<td>0.0596438</td>\n",
       "<td>0.3372223</td>\n",
       "<td>1.3873246</td>\n",
       "<td>0.0894886</td>\n",
       "<td>0.0830578</td>\n",
       "<td>0.3681542</td>\n",
       "<td>0.3680679</td>\n",
       "<td>0.0337079</td>\n",
       "<td>0.9711075</td>\n",
       "<td>-66.2777707</td>\n",
       "<td>38.7324632</td>\n",
       "<td>0.3690588</td></tr>\n",
       "<tr><td>14</td>\n",
       "<td>0.7999432</td>\n",
       "<td>0.0309274</td>\n",
       "<td>0.1712875</td>\n",
       "<td>1.2353740</td>\n",
       "<td>0.0454545</td>\n",
       "<td>0.0445700</td>\n",
       "<td>0.3278310</td>\n",
       "<td>0.3276450</td>\n",
       "<td>0.0171215</td>\n",
       "<td>0.9882290</td>\n",
       "<td>-82.8712486</td>\n",
       "<td>23.5373952</td>\n",
       "<td>0.2563001</td></tr>\n",
       "<tr><td>15</td>\n",
       "<td>0.8999006</td>\n",
       "<td>0.0159662</td>\n",
       "<td>0.0695856</td>\n",
       "<td>1.1058828</td>\n",
       "<td>0.0184659</td>\n",
       "<td>0.0226224</td>\n",
       "<td>0.2934680</td>\n",
       "<td>0.2937643</td>\n",
       "<td>0.0069556</td>\n",
       "<td>0.9951846</td>\n",
       "<td>-93.0414447</td>\n",
       "<td>10.5882782</td>\n",
       "<td>0.1297033</td></tr>\n",
       "<tr><td>16</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0041373</td>\n",
       "<td>0.0481063</td>\n",
       "<td>1.0</td>\n",
       "<td>0.0127660</td>\n",
       "<td>0.0107384</td>\n",
       "<td>0.2653699</td>\n",
       "<td>0.2654336</td>\n",
       "<td>0.0048154</td>\n",
       "<td>1.0</td>\n",
       "<td>-95.1893719</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "</div></div>\n",
       "<div style='margin: 1em 0 1em 0;'>\n",
       "<style>\n",
       "\n",
       "#h2o-table-20.h2o-container {\n",
       "  overflow-x: auto;\n",
       "}\n",
       "#h2o-table-20 .h2o-table {\n",
       "  /* width: 100%; */\n",
       "  margin-top: 1em;\n",
       "  margin-bottom: 1em;\n",
       "}\n",
       "#h2o-table-20 .h2o-table caption {\n",
       "  white-space: nowrap;\n",
       "  caption-side: top;\n",
       "  text-align: left;\n",
       "  /* margin-left: 1em; */\n",
       "  margin: 0;\n",
       "  font-size: larger;\n",
       "}\n",
       "#h2o-table-20 .h2o-table thead {\n",
       "  white-space: nowrap; \n",
       "  position: sticky;\n",
       "  top: 0;\n",
       "  box-shadow: 0 -1px inset;\n",
       "}\n",
       "#h2o-table-20 .h2o-table tbody {\n",
       "  overflow: auto;\n",
       "}\n",
       "#h2o-table-20 .h2o-table th,\n",
       "#h2o-table-20 .h2o-table td {\n",
       "  text-align: right;\n",
       "  /* border: 1px solid; */\n",
       "}\n",
       "#h2o-table-20 .h2o-table tr:nth-child(even) {\n",
       "  /* background: #F5F5F5 */\n",
       "}\n",
       "\n",
       "</style>      \n",
       "<div id=\"h2o-table-20\" class=\"h2o-container\">\n",
       "  <table class=\"h2o-table\">\n",
       "    <caption>Cross-Validation Metrics Summary: </caption>\n",
       "    <thead><tr><th></th>\n",
       "<th>mean</th>\n",
       "<th>sd</th>\n",
       "<th>cv_1_valid</th>\n",
       "<th>cv_2_valid</th>\n",
       "<th>cv_3_valid</th>\n",
       "<th>cv_4_valid</th>\n",
       "<th>cv_5_valid</th></tr></thead>\n",
       "    <tbody><tr><td>accuracy</td>\n",
       "<td>0.7810399</td>\n",
       "<td>0.0178729</td>\n",
       "<td>0.7913521</td>\n",
       "<td>0.7698687</td>\n",
       "<td>0.8004246</td>\n",
       "<td>0.7559775</td>\n",
       "<td>0.7875767</td></tr>\n",
       "<tr><td>aic</td>\n",
       "<td>1164.9021</td>\n",
       "<td>61.866287</td>\n",
       "<td>1207.9692</td>\n",
       "<td>1216.1278</td>\n",
       "<td>1133.7238</td>\n",
       "<td>1196.0629</td>\n",
       "<td>1070.6268</td></tr>\n",
       "<tr><td>auc</td>\n",
       "<td>0.8502371</td>\n",
       "<td>0.0063955</td>\n",
       "<td>0.8421056</td>\n",
       "<td>0.8503820</td>\n",
       "<td>0.8568639</td>\n",
       "<td>0.8457873</td>\n",
       "<td>0.8560467</td></tr>\n",
       "<tr><td>err</td>\n",
       "<td>0.2189601</td>\n",
       "<td>0.0178729</td>\n",
       "<td>0.2086479</td>\n",
       "<td>0.2301313</td>\n",
       "<td>0.1995754</td>\n",
       "<td>0.2440225</td>\n",
       "<td>0.2124233</td></tr>\n",
       "<tr><td>err_count</td>\n",
       "<td>308.6</td>\n",
       "<td>30.810713</td>\n",
       "<td>304.0</td>\n",
       "<td>333.0</td>\n",
       "<td>282.0</td>\n",
       "<td>347.0</td>\n",
       "<td>277.0</td></tr>\n",
       "<tr><td>f0point5</td>\n",
       "<td>0.5967632</td>\n",
       "<td>0.0185078</td>\n",
       "<td>0.5931818</td>\n",
       "<td>0.593415</td>\n",
       "<td>0.6143264</td>\n",
       "<td>0.5692979</td>\n",
       "<td>0.6135949</td></tr>\n",
       "<tr><td>f1</td>\n",
       "<td>0.6467064</td>\n",
       "<td>0.0102975</td>\n",
       "<td>0.6319613</td>\n",
       "<td>0.6505771</td>\n",
       "<td>0.6475</td>\n",
       "<td>0.6433711</td>\n",
       "<td>0.6601227</td></tr>\n",
       "<tr><td>f2</td>\n",
       "<td>0.7068882</td>\n",
       "<td>0.0261811</td>\n",
       "<td>0.6761658</td>\n",
       "<td>0.7199257</td>\n",
       "<td>0.6844609</td>\n",
       "<td>0.7396030</td>\n",
       "<td>0.7142857</td></tr>\n",
       "<tr><td>lift_top_group</td>\n",
       "<td>3.4178927</td>\n",
       "<td>0.2412670</td>\n",
       "<td>3.6952899</td>\n",
       "<td>3.1351666</td>\n",
       "<td>3.623077</td>\n",
       "<td>3.2346456</td>\n",
       "<td>3.4012842</td></tr>\n",
       "<tr><td>loglikelihood</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td>\n",
       "<td>0.0</td></tr>\n",
       "<tr><td>---</td>\n",
       "<td>---</td>\n",
       "<td>---</td>\n",
       "<td>---</td>\n",
       "<td>---</td>\n",
       "<td>---</td>\n",
       "<td>---</td>\n",
       "<td>---</td></tr>\n",
       "<tr><td>mean_per_class_error</td>\n",
       "<td>0.2277239</td>\n",
       "<td>0.0053745</td>\n",
       "<td>0.2358304</td>\n",
       "<td>0.2285458</td>\n",
       "<td>0.2285968</td>\n",
       "<td>0.2232446</td>\n",
       "<td>0.2224020</td></tr>\n",
       "<tr><td>mse</td>\n",
       "<td>0.1334272</td>\n",
       "<td>0.0035193</td>\n",
       "<td>0.1321111</td>\n",
       "<td>0.1364434</td>\n",
       "<td>0.1282075</td>\n",
       "<td>0.1368108</td>\n",
       "<td>0.1335631</td></tr>\n",
       "<tr><td>null_deviance</td>\n",
       "<td>1630.3737</td>\n",
       "<td>65.76145</td>\n",
       "<td>1648.7882</td>\n",
       "<td>1707.6018</td>\n",
       "<td>1613.0315</td>\n",
       "<td>1652.984</td>\n",
       "<td>1529.4628</td></tr>\n",
       "<tr><td>pr_auc</td>\n",
       "<td>0.6674669</td>\n",
       "<td>0.0153246</td>\n",
       "<td>0.6578724</td>\n",
       "<td>0.6730958</td>\n",
       "<td>0.675541</td>\n",
       "<td>0.6461514</td>\n",
       "<td>0.6846741</td></tr>\n",
       "<tr><td>precision</td>\n",
       "<td>0.5678514</td>\n",
       "<td>0.0255227</td>\n",
       "<td>0.569869</td>\n",
       "<td>0.5605786</td>\n",
       "<td>0.5940367</td>\n",
       "<td>0.5287162</td>\n",
       "<td>0.5860566</td></tr>\n",
       "<tr><td>r2</td>\n",
       "<td>0.3154401</td>\n",
       "<td>0.0136175</td>\n",
       "<td>0.3001858</td>\n",
       "<td>0.3178450</td>\n",
       "<td>0.3296201</td>\n",
       "<td>0.3025007</td>\n",
       "<td>0.3270491</td></tr>\n",
       "<tr><td>recall</td>\n",
       "<td>0.7545836</td>\n",
       "<td>0.0469247</td>\n",
       "<td>0.7092391</td>\n",
       "<td>0.775</td>\n",
       "<td>0.7115384</td>\n",
       "<td>0.8215223</td>\n",
       "<td>0.755618</td></tr>\n",
       "<tr><td>residual_deviance</td>\n",
       "<td>1157.7021</td>\n",
       "<td>61.52713</td>\n",
       "<td>1199.9692</td>\n",
       "<td>1210.1278</td>\n",
       "<td>1125.7238</td>\n",
       "<td>1188.0629</td>\n",
       "<td>1064.6268</td></tr>\n",
       "<tr><td>rmse</td>\n",
       "<td>0.3652513</td>\n",
       "<td>0.0048323</td>\n",
       "<td>0.3634709</td>\n",
       "<td>0.3693825</td>\n",
       "<td>0.3580608</td>\n",
       "<td>0.3698794</td>\n",
       "<td>0.3654629</td></tr>\n",
       "<tr><td>specificity</td>\n",
       "<td>0.7899685</td>\n",
       "<td>0.0402957</td>\n",
       "<td>0.8191001</td>\n",
       "<td>0.7679083</td>\n",
       "<td>0.8312679</td>\n",
       "<td>0.7319885</td>\n",
       "<td>0.7995781</td></tr></tbody>\n",
       "  </table>\n",
       "</div>\n",
       "<pre style='font-size: smaller; margin-bottom: 1em;'>[24 rows x 8 columns]</pre></div><pre style=\"font-size: smaller; margin: 1em 0 0 0;\">\n",
       "\n",
       "[tips]\n",
       "Use `model.explain()` to inspect the model.\n",
       "--\n",
       "Use `h2o.display.toggle_user_tips()` to switch on/off this section.</pre>"
      ],
      "text/plain": [
       "Model Details\n",
       "=============\n",
       "H2OStackedEnsembleEstimator : Stacked Ensemble\n",
       "Model Key: StackedEnsemble_BestOfFamily_2_AutoML_2_20250117_182721\n",
       "\n",
       "\n",
       "Model Summary for Stacked Ensemble: \n",
       "key                                   value\n",
       "------------------------------------  ----------------\n",
       "Stacking strategy                     cross_validation\n",
       "Number of base models (used / total)  2/4\n",
       "# GBM base models (used / total)      1/1\n",
       "# XGBoost base models (used / total)  0/1\n",
       "# GLM base models (used / total)      1/1\n",
       "# DRF base models (used / total)      0/1\n",
       "Metalearner algorithm                 GLM\n",
       "Metalearner fold assignment scheme    Random\n",
       "Metalearner nfolds                    5\n",
       "Metalearner fold_column\n",
       "Custom metalearner hyperparameters    None\n",
       "\n",
       "ModelMetricsBinomialGLM: stackedensemble\n",
       "** Reported on train data. **\n",
       "\n",
       "MSE: 0.12280258481192449\n",
       "RMSE: 0.3504319974145119\n",
       "LogLoss: 0.38118316635829386\n",
       "AUC: 0.8755385872855243\n",
       "AUCPR: 0.7225887060960569\n",
       "Gini: 0.7510771745710485\n",
       "Null degrees of freedom: 7042\n",
       "Residual degrees of freedom: 7040\n",
       "Null deviance: 8150.145899019416\n",
       "Residual deviance: 5369.346081322927\n",
       "AIC: 5375.346081322927\n",
       "\n",
       "Confusion Matrix (Act/Pred) for max f1 @ threshold = 0.28863204785206925\n",
       "       No    Yes    Error    Rate\n",
       "-----  ----  -----  -------  ---------------\n",
       "No     4002  1172   0.2265   (1172.0/5174.0)\n",
       "Yes    341   1528   0.1825   (341.0/1869.0)\n",
       "Total  4343  2700   0.2148   (1513.0/7043.0)\n",
       "\n",
       "Maximum Metrics: Maximum metrics at their respective thresholds\n",
       "metric                       threshold    value     idx\n",
       "---------------------------  -----------  --------  -----\n",
       "max f1                       0.288632     0.668855  229\n",
       "max f2                       0.163993     0.770925  289\n",
       "max f0point5                 0.553383     0.67799   117\n",
       "max accuracy                 0.509217     0.823371  137\n",
       "max precision                0.868569     1         0\n",
       "max recall                   0.0125838    1         391\n",
       "max specificity              0.868569     1         0\n",
       "max absolute_mcc             0.288632     0.536726  229\n",
       "max min_per_class_accuracy   0.309673     0.788122  220\n",
       "max mean_per_class_accuracy  0.288632     0.795516  229\n",
       "max tns                      0.868569     5174      0\n",
       "max fns                      0.868569     1867      0\n",
       "max fps                      0.00503849   5174      399\n",
       "max tps                      0.0125838    1869      391\n",
       "max tnr                      0.868569     1         0\n",
       "max fnr                      0.868569     0.99893   0\n",
       "max fpr                      0.00503849   1         399\n",
       "max tpr                      0.0125838    1         391\n",
       "\n",
       "Gains/Lift Table: Avg response rate: 26.54 %, avg score: 26.55 %\n",
       "group    cumulative_data_fraction    lower_threshold    lift       cumulative_lift    response_rate    score      cumulative_response_rate    cumulative_score    capture_rate    cumulative_capture_rate    gain      cumulative_gain    kolmogorov_smirnov\n",
       "-------  --------------------------  -----------------  ---------  -----------------  ---------------  ---------  --------------------------  ------------------  --------------  -------------------------  --------  -----------------  --------------------\n",
       "1        0.0100809                   0.824912           3.66218    3.66218            0.971831         0.840837   0.971831                    0.840837            0.0369181       0.0369181                  266.218   266.218            0.0365316\n",
       "2        0.0200199                   0.801617           3.33766    3.50107            0.885714         0.813029   0.929078                    0.827031            0.0331728       0.070091                   233.766   250.107            0.0681582\n",
       "3        0.0301008                   0.784829           3.3968     3.46615            0.901408         0.792067   0.919811                    0.815322            0.0342429       0.104334                   239.68    246.615            0.101048\n",
       "4        0.0400398                   0.769314           3.44533    3.46098            0.914286         0.777204   0.91844                     0.80586             0.0342429       0.138577                   244.533   246.098            0.134131\n",
       "5        0.0501207                   0.754344           3.1845     3.40537            0.84507          0.761895   0.903683                    0.797017            0.0321027       0.17068                    218.45    240.537            0.164108\n",
       "6        0.100099                    0.665217           2.82624    3.11622            0.75             0.708144   0.82695                     0.752643            0.141252        0.311932                   182.624   211.622            0.288352\n",
       "7        0.150078                    0.594758           2.50508    2.9127             0.664773         0.629425   0.772942                    0.71161             0.125201        0.437132                   150.508   191.27             0.390746\n",
       "8        0.200057                    0.530679           2.09827    2.70924            0.556818         0.563169   0.71895                     0.674526            0.104869        0.542001                   109.827   170.924            0.465465\n",
       "9        0.300014                    0.381833           1.654      2.35766            0.43892          0.456573   0.625651                    0.601909            0.165329        0.70733                    65.3995   135.766            0.55445\n",
       "10       0.399972                    0.272804           1.23648    2.07746            0.328125         0.325797   0.551296                    0.532906            0.123596        0.830926                   23.6482   107.746            0.586627\n",
       "11       0.500071                    0.177844           0.753665   1.81248            0.2              0.224613   0.480977                    0.471194            0.0754414       0.906367                   -24.6335  81.2477            0.553062\n",
       "12       0.600028                    0.110988           0.487099   1.59168            0.129261         0.142033   0.422385                    0.41636             0.0486891       0.955056                   -51.2901  59.1685            0.483274\n",
       "13       0.699986                    0.0574955          0.278342   1.40414            0.0738636        0.0820331  0.372617                    0.368618            0.0278224       0.982879                   -72.1658  40.4141            0.385082\n",
       "14       0.799943                    0.0293164          0.101702   1.24139            0.0269886        0.0422363  0.329428                    0.327835            0.0101659       0.993044                   -89.8298  24.1394            0.262855\n",
       "15       0.899901                    0.0157667          0.0535273  1.10945            0.0142045        0.021663   0.294415                    0.293827            0.00535045      0.998395                   -94.6473  10.945             0.134073\n",
       "16       1                           0.00443439         0.0160354  1                  0.00425532       0.0106067  0.26537                     0.265477            0.00160514      1                          -98.3965  0                  0\n",
       "\n",
       "ModelMetricsBinomialGLM: stackedensemble\n",
       "** Reported on cross-validation data. **\n",
       "\n",
       "MSE: 0.13343936715812627\n",
       "RMSE: 0.36529353560955097\n",
       "LogLoss: 0.41095045439479133\n",
       "AUC: 0.8500058323473151\n",
       "AUCPR: 0.6660452986059002\n",
       "Gini: 0.7000116646946302\n",
       "Null degrees of freedom: 7042\n",
       "Residual degrees of freedom: 7039\n",
       "Null deviance: 8151.868367609408\n",
       "Residual deviance: 5788.648100605031\n",
       "AIC: 5796.648100605031\n",
       "\n",
       "Confusion Matrix (Act/Pred) for max f1 @ threshold = 0.288417727959037\n",
       "       No    Yes    Error    Rate\n",
       "-----  ----  -----  -------  ---------------\n",
       "No     3937  1237   0.2391   (1237.0/5174.0)\n",
       "Yes    407   1462   0.2178   (407.0/1869.0)\n",
       "Total  4344  2699   0.2334   (1644.0/7043.0)\n",
       "\n",
       "Maximum Metrics: Maximum metrics at their respective thresholds\n",
       "metric                       threshold    value     idx\n",
       "---------------------------  -----------  --------  -----\n",
       "max f1                       0.288418     0.640105  234\n",
       "max f2                       0.158583     0.751561  296\n",
       "max f0point5                 0.516365     0.64035   135\n",
       "max accuracy                 0.516365     0.807752  135\n",
       "max precision                0.886238     1         0\n",
       "max recall                   0.00711245   1         397\n",
       "max specificity              0.886238     1         0\n",
       "max absolute_mcc             0.265055     0.493773  245\n",
       "max min_per_class_accuracy   0.296376     0.768325  230\n",
       "max mean_per_class_accuracy  0.265055     0.775319  245\n",
       "max tns                      0.886238     5174      0\n",
       "max fns                      0.886238     1867      0\n",
       "max fps                      0.00493952   5174      399\n",
       "max tps                      0.00711245   1869      397\n",
       "max tnr                      0.886238     1         0\n",
       "max fnr                      0.886238     0.99893   0\n",
       "max fpr                      0.00493952   1         399\n",
       "max tpr                      0.00711245   1         397\n",
       "\n",
       "Gains/Lift Table: Avg response rate: 26.54 %, avg score: 26.54 %\n",
       "group    cumulative_data_fraction    lower_threshold    lift       cumulative_lift    response_rate    score      cumulative_response_rate    cumulative_score    capture_rate    cumulative_capture_rate    gain      cumulative_gain    kolmogorov_smirnov\n",
       "-------  --------------------------  -----------------  ---------  -----------------  ---------------  ---------  --------------------------  ------------------  --------------  -------------------------  --------  -----------------  --------------------\n",
       "1        0.0100809                   0.821374           3.44988    3.44988            0.915493         0.838295   0.915493                    0.838295            0.034778        0.034778                   244.988   244.988            0.0336183\n",
       "2        0.0200199                   0.795552           3.12233    3.28726            0.828571         0.806549   0.87234                     0.822534            0.0310326       0.0658106                  212.233   228.726            0.0623317\n",
       "3        0.0301008                   0.778703           3.07835    3.2173             0.816901         0.787096   0.853774                    0.810666            0.0310326       0.0968432                  207.835   221.73             0.0908517\n",
       "4        0.0400398                   0.765057           3.12233    3.19372            0.828571         0.772595   0.847518                    0.801215            0.0310326       0.127876                   212.233   219.372            0.119565\n",
       "5        0.0501207                   0.745531           3.07835    3.17052            0.816901         0.754414   0.84136                     0.791802            0.0310326       0.158909                   207.835   217.052            0.148085\n",
       "6        0.100099                    0.6593             2.62284    2.89707            0.696023         0.700896   0.768794                    0.746413            0.131086        0.289995                   162.284   189.707            0.258491\n",
       "7        0.150078                    0.594677           2.33379    2.70949            0.619318         0.626025   0.719016                    0.706322            0.11664         0.406635                   133.379   170.949            0.349232\n",
       "8        0.200057                    0.52833            2.05545    2.54609            0.545455         0.560833   0.675656                    0.669976            0.102729        0.509363                   105.545   154.609            0.421037\n",
       "9        0.300014                    0.385777           1.61653    2.23638            0.428977         0.458362   0.593469                    0.599471            0.161584        0.670947                   61.6526   123.638            0.504925\n",
       "10       0.399972                    0.275201           1.26325    1.99319            0.335227         0.323436   0.528931                    0.530487            0.126271        0.797218                   26.3245   99.3186            0.540743\n",
       "11       0.500071                    0.18228            0.839187   1.76219            0.222695         0.2273     0.467632                    0.469798            0.0840021       0.88122                    -16.0813  76.219             0.518831\n",
       "12       0.600028                    0.110354           0.562037   1.56226            0.149148         0.144139   0.414576                    0.415547            0.0561798       0.9374                     -43.7963  56.2259            0.45924\n",
       "13       0.699986                    0.0596438          0.337222   1.38732            0.0894886        0.0830578  0.368154                    0.368068            0.0337079       0.971108                   -66.2778  38.7325            0.369059\n",
       "14       0.799943                    0.0309274          0.171288   1.23537            0.0454545        0.04457    0.327831                    0.327645            0.0171215       0.988229                   -82.8712  23.5374            0.2563\n",
       "15       0.899901                    0.0159662          0.0695856  1.10588            0.0184659        0.0226224  0.293468                    0.293764            0.00695559      0.995185                   -93.0414  10.5883            0.129703\n",
       "16       1                           0.00413732         0.0481063  1                  0.012766         0.0107384  0.26537                     0.265434            0.00481541      1                          -95.1894  0                  0\n",
       "\n",
       "Cross-Validation Metrics Summary: \n",
       "                      mean        sd            cv_1_valid    cv_2_valid    cv_3_valid    cv_4_valid    cv_5_valid\n",
       "--------------------  ----------  ------------  ------------  ------------  ------------  ------------  ------------\n",
       "accuracy              0.7810399   0.017872874   0.7913521     0.7698687     0.80042464    0.7559775     0.7875767\n",
       "aic                   1164.9021   61.866287     1207.9692     1216.1278     1133.7238     1196.0629     1070.6268\n",
       "auc                   0.85023713  0.006395509   0.84210557    0.85038203    0.8568639     0.8457873     0.85604674\n",
       "err                   0.21896008  0.017872874   0.2086479     0.23013131    0.19957536    0.2440225     0.21242331\n",
       "err_count             308.6       30.810713     304.0         333.0         282.0         347.0         277.0\n",
       "f0point5              0.5967632   0.018507762   0.5931818     0.593415      0.61432636    0.5692979     0.6135949\n",
       "f1                    0.6467064   0.010297492   0.6319613     0.6505771     0.6475        0.64337105    0.6601227\n",
       "f2                    0.7068882   0.026181143   0.6761658     0.7199257     0.6844609     0.73960304    0.71428573\n",
       "lift_top_group        3.4178927   0.24126701    3.6952899     3.1351666     3.623077      3.2346456     3.4012842\n",
       "loglikelihood         0.0         0.0           0.0           0.0           0.0           0.0           0.0\n",
       "---                   ---         ---           ---           ---           ---           ---           ---\n",
       "mean_per_class_error  0.22772393  0.005374468   0.23583038    0.22854584    0.22859684    0.2232446     0.22240198\n",
       "mse                   0.1334272   0.0035192964  0.13211112    0.13644344    0.12820753    0.13681076    0.13356312\n",
       "null_deviance         1630.3737   65.76145      1648.7882     1707.6018     1613.0315     1652.984      1529.4628\n",
       "pr_auc                0.66746694  0.015324555   0.65787244    0.6730958     0.675541      0.64615136    0.6846741\n",
       "precision             0.5678514   0.02552267    0.569869      0.56057864    0.5940367     0.5287162     0.58605665\n",
       "r2                    0.31544012  0.013617506   0.3001858     0.31784502    0.3296201     0.3025007     0.32704905\n",
       "recall                0.7545836   0.04692466    0.7092391     0.775         0.71153843    0.8215223     0.755618\n",
       "residual_deviance     1157.7021   61.52713      1199.9692     1210.1278     1125.7238     1188.0629     1064.6268\n",
       "rmse                  0.3652513   0.004832292   0.3634709     0.36938253    0.35806078    0.3698794     0.3654629\n",
       "specificity           0.78996855  0.04029568    0.8191001     0.76790833    0.8312679     0.7319885     0.7995781\n",
       "[24 rows x 8 columns]\n",
       "\n",
       "\n",
       "[tips]\n",
       "Use `model.explain()` to inspect the model.\n",
       "--\n",
       "Use `h2o.display.toggle_user_tips()` to switch on/off this section."
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Load the model\n",
    "model = h2o.get_model(ml_agent.get_best_model_id())\n",
    "\n",
    "model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Make Predictions\n",
    "\n",
    "Run the code to make predictions using the model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Parse progress: |████████████████████████████████████████████████████████████████| (done) 100%\n",
      "stackedensemble prediction progress: |███████████████████████████████████████████| (done) 100%\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<table class='dataframe'>\n",
       "<thead>\n",
       "<tr><th>predict  </th><th style=\"text-align: right;\">      No</th><th style=\"text-align: right;\">      Yes</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr><td>Yes      </td><td style=\"text-align: right;\">0.335686</td><td style=\"text-align: right;\">0.664314 </td></tr>\n",
       "<tr><td>No       </td><td style=\"text-align: right;\">0.96382 </td><td style=\"text-align: right;\">0.0361802</td></tr>\n",
       "<tr><td>Yes      </td><td style=\"text-align: right;\">0.651524</td><td style=\"text-align: right;\">0.348476 </td></tr>\n",
       "<tr><td>No       </td><td style=\"text-align: right;\">0.971191</td><td style=\"text-align: right;\">0.028809 </td></tr>\n",
       "<tr><td>Yes      </td><td style=\"text-align: right;\">0.357133</td><td style=\"text-align: right;\">0.642867 </td></tr>\n",
       "<tr><td>Yes      </td><td style=\"text-align: right;\">0.168803</td><td style=\"text-align: right;\">0.831197 </td></tr>\n",
       "<tr><td>Yes      </td><td style=\"text-align: right;\">0.582106</td><td style=\"text-align: right;\">0.417894 </td></tr>\n",
       "<tr><td>No       </td><td style=\"text-align: right;\">0.753557</td><td style=\"text-align: right;\">0.246443 </td></tr>\n",
       "<tr><td>Yes      </td><td style=\"text-align: right;\">0.419517</td><td style=\"text-align: right;\">0.580483 </td></tr>\n",
       "<tr><td>No       </td><td style=\"text-align: right;\">0.982409</td><td style=\"text-align: right;\">0.0175906</td></tr>\n",
       "</tbody>\n",
       "</table><pre style='font-size: smaller; margin-bottom: 1em;'>[7043 rows x 3 columns]</pre>"
      ],
      "text/plain": [
       "predict          No        Yes\n",
       "---------  --------  ---------\n",
       "Yes        0.335686  0.664314\n",
       "No         0.96382   0.0361802\n",
       "Yes        0.651524  0.348476\n",
       "No         0.971191  0.028809\n",
       "Yes        0.357133  0.642867\n",
       "Yes        0.168803  0.831197\n",
       "Yes        0.582106  0.417894\n",
       "No         0.753557  0.246443\n",
       "Yes        0.419517  0.580483\n",
       "No         0.982409  0.0175906\n",
       "[7043 rows x 3 columns]\n"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Make predictions using the loaded model\n",
    "model.predict(h2o.H2OFrame(df))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Want To Become A Full-Stack Generative AI Data Scientist?\n",
    "\n",
    "![Generative AI Data Scientist](../../img/become_a_generative_ai_data_scientist.jpg)\n",
    "\n",
    "I teach Generative AI Data Science to help you build AI-powered data science apps. [**Register for my next Generative AI for Data Scientists workshop here.**](https://learn.business-science.io/ai-register)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ds4b_301p_dev",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
